Shortcut Modal

Use the ShortcutModal component to
display and manage keyboard shortcuts, with support for light and dark themes.

Keyboard Shortcuts

Download canvas as a PNG image

CtrlB

Copy canvas to clipboard as a PNG image

CtrlC

Open quick access menu

CtrlK

Paste image from clipboard to add a new image annotation layer

CtrlShiftV

Clear editor state

CtrlShiftF

Delete selected annotation layer

Del
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 NameTypeDescription
keystringShortcut Key
descriptionstringDescription of the shortcut key
modestringSpecifies the color scheme. light / dark
Built byAyushmaan Singh. The source code is available onGithub