command
neobrutalism/commandFreeComponent
neobrutalism publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by neobrutalism on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://neobrutalism.com/r/command.jsonSource
1"use client"23import * as React from "react"4import { Command as CommandPrimitive } from "cmdk"5import { CheckIcon, SearchIcon } from "lucide-react"67import { cn } from "@/lib/utils"8import {9 Dialog,10 DialogContent,11 DialogDescription,12 DialogHeader,13 DialogTitle,14} from "@/components/ui/dialog"15import { InputGroup, InputGroupAddon } from "@/components/ui/input-group"1617function Command({18 className,19 ...props20}: React.ComponentProps<typeof CommandPrimitive>) {21 return (22 <CommandPrimitive23 data-slot="command"24 className={cn(25 "flex size-full flex-col overflow-hidden rounded border-2 bg-popover p-1 text-popover-foreground",26 className27 )}28 {...props}29 />30 )31}3233function CommandDialog({34 title = "Command Palette",35 description = "Search for a command to run...",36 children,37 className,38 showCloseButton = false,39 ...props40}: Omit<React.ComponentProps<typeof Dialog>, "children"> & {41 title?: string42 description?: string43 className?: string44 showCloseButton?: boolean45 children: React.ReactNode46}) {47 return (48 <Dialog {...props}>49 <DialogHeader className="sr-only">50 <DialogTitle>{title}</DialogTitle>51 <DialogDescription>{description}</DialogDescription>52 </DialogHeader>53 <DialogContent54 className={cn(55 "top-1/3 translate-y-0 overflow-hidden rounded p-0",56 className57 )}58 showCloseButton={showCloseButton}59 >60 {children}61 </DialogContent>62 </Dialog>63 )64}6566function CommandInput({67 className,68 ...props69}: React.ComponentProps<typeof CommandPrimitive.Input>) {70 return (71 <div data-slot="command-input-wrapper" className="p-1 pb-0">72 <InputGroup className="h-8! rounded border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!">73 <CommandPrimitive.Input74 data-slot="command-input"75 className={cn(76 "w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",77 className78 )}79 {...props}80 />81 <InputGroupAddon>82 <SearchIcon className="size-4 shrink-0 opacity-50" />83 </InputGroupAddon>84 </InputGroup>85 </div>86 )87}8889function CommandList({90 className,91 ...props92}: React.ComponentProps<typeof CommandPrimitive.List>) {93 return (94 <CommandPrimitive.List95 data-slot="command-list"96 className={cn(97// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from neobrutalism
All 54 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | neobrutalism | Components | Free | 2 deps | |
| alertalert | neobrutalism | Components | Free | 2 deps | |
| alert-dialogalert-dialog | neobrutalism | Components | Free | 1 dep | |
| aspect-ratioaspect-ratio | neobrutalism | Components | Free | 1 dep | |
| avataravatar | neobrutalism | Components | Free | 1 dep | |
| badgebadge | neobrutalism | Components | Free | 2 deps | |
| breadcrumbbreadcrumb | neobrutalism | Components | Free | 2 deps | |
| buttonbutton | neobrutalism | Components | Free | 2 deps |
