@labmgm/command
v0.1.2
Published
MGM-styled command palette backed by cmdk: <CommandPalette>, <CommandGroup>, <CommandItem>, with keyboard shortcuts.
Readme
@labmgm/command
⌘K command palette for MGM Laboratory apps. Backed by cmdk.
import {
CommandPalette, CommandGroup, CommandItem, CommandSeparator, CommandShortcut,
} from '@labmgm/command';
<CommandPalette>
<CommandGroup heading="Pages">
<CommandItem onSelect={() => router.push('/discover')}>
Discover <CommandShortcut>⌘D</CommandShortcut>
</CommandItem>
<CommandItem onSelect={() => router.push('/library')}>Library</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Actions">
<CommandItem onSelect={signOut}>Sign out</CommandItem>
</CommandGroup>
</CommandPalette>The palette opens on ⌘K (Cmd+K) or Ctrl+K. Set shortcut={false} to disable.
