@labmgm/command
v0.1.4
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. Mount the palette anywhere in your tree; pressing ⌘K (Cmd+K on macOS, Ctrl+K on Windows/Linux) opens it.
pnpm add @labmgm/commandExample
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>;Props
open/defaultOpen/onOpenChange— control the palette stateshortcut={false}— disable the global ⌘K bindingplaceholder— input placeholder text
License
MIT © MGM Laboratory
