Command
boldkit/commandFreeComponent
Fast, composable, command menu for React with neubrutalism styling
Live preview
live · rendered by the registry
Rendered by boldkit on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://boldkit.dev/r/command.jsonSource
1import * as React from 'react'2import * as DialogPrimitive from '@radix-ui/react-dialog'3import { type DialogProps } from '@radix-ui/react-dialog'4import { Command as CommandPrimitive } from 'cmdk'5import { Search } from 'lucide-react'6import { cn } from '@/lib/utils'7import { Dialog, DialogPortal, DialogOverlay } from '@/components/ui/dialog'89const Command = React.forwardRef<10 React.ElementRef<typeof CommandPrimitive>,11 React.ComponentPropsWithoutRef<typeof CommandPrimitive>12>(({ className, ...props }, ref) => (13 <CommandPrimitive14 ref={ref}15 className={cn(16 'flex h-full w-full flex-col overflow-hidden bg-popover text-popover-foreground',17 className18 )}19 {...props}20 />21))22Command.displayName = CommandPrimitive.displayName2324interface CommandDialogProps extends DialogProps {25 /** Accessible title for the dialog (visually hidden). */26 title?: string27 /** Accessible description for the dialog (visually hidden). */28 description?: string29}3031const CommandDialog = ({32 children,33 title = 'Command Menu',34 description = 'Search for a command to run.',35 ...props36}: CommandDialogProps) => {37 return (38 <Dialog {...props}>39 <DialogPortal>40 <DialogOverlay />41 <DialogPrimitive.Content42 className="fixed left-[50%] top-[20%] z-50 w-full max-w-lg translate-x-[-50%] border-3 border-foreground bg-background shadow-[8px_8px_0px_hsl(var(--shadow-color))] duration-100 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"43 >44 <DialogPrimitive.Title className="sr-only">{title}</DialogPrimitive.Title>45 <DialogPrimitive.Description className="sr-only">{description}</DialogPrimitive.Description>46 <Command className="[&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-bold [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12">47 {children}48 </Command>49 </DialogPrimitive.Content>50 </DialogPortal>51 </Dialog>52 )53}5455const CommandInput = React.forwardRef<56 React.ElementRef<typeof CommandPrimitive.Input>,57 React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>58>(({ className, ...props }, ref) => (59// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from boldkit
All 94 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | boldkit | Components | Free | 2 deps | |
| Alertalert | boldkit | Components | Free | 2 deps | |
| Alert Dialogalert-dialog | boldkit | Components | Free | 1 dep | |
| ASCII Shapesascii-shapes | boldkit | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | boldkit | Components | Free | 1 dep | |
| Avataravatar | boldkit | Components | Free | 1 dep | |
| Badgebadge | boldkit | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | boldkit | Components | Free | 2 deps |
