Shortcut Modal
Use the ShortcutModal component to
display and manage keyboard shortcuts, with support for light and dark themes.
Installation
npx @ayushmxxn/serenity-ui@latest add shortcutmodal
Usage
import React from 'react';
import ShortcutModal from './components/ui/ShortcutModal';
const shortcuts = [
{ key: 'Ctrl+B', description: 'Download canvas as a PNG image' },
{ key: 'Ctrl+C', description: 'Copy canvas to clipboard as a PNG image' },
{ key: 'Ctrl+K', description: 'Open quick access menu' },
{ key: 'Ctrl+Shift+V', description: 'Paste image from clipboard to add a new image annotation layer' },
{ key: 'Ctrl+Shift+F', description: 'Clear editor state' },
{ key: 'Del', description: 'Delete selected annotation layer' },
];
const Home: React.FC = () => {
return (
<div>
<ShortcutModal shortcuts={shortcuts} mode='dark'/>
</div>
);
};
export default Home;
Props
Prop Name | Type | Description |
---|---|---|
key | string | Shortcut Key |
description | string | Description of the shortcut key |
mode | string | Specifies the color scheme. light / dark |