command
nrjdalal/commandFreeComponent
acme publishes no description for this item.
Install it
npx shadcn@latest add https://nrjdalal.dev/r/command.jsonSource
1"use client"23import {4 Dialog,5 DialogContent,6 DialogDescription,7 DialogHeader,8 DialogTitle,9} from "@/components/ui/dialog"10import { cn } from "@/lib/utils"11import { Command as CommandPrimitive } from "cmdk"12import { SearchIcon } from "lucide-react"13import * as React from "react"1415function Command({16 className,17 ...props18}: React.ComponentProps<typeof CommandPrimitive>) {19 return (20 <CommandPrimitive21 data-slot="command"22 className={cn(23 "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",24 className,25 )}26 {...props}27 />28 )29}3031function CommandDialog({32 title = "Command Palette",33 description = "Search for a command to run...",34 children,35 ...props36}: React.ComponentProps<typeof Dialog> & {37 title?: string38 description?: string39}) {40 return (41 <Dialog {...props}>42 <DialogHeader className="sr-only">43 <DialogTitle>{title}</DialogTitle>44 <DialogDescription>{description}</DialogDescription>45 </DialogHeader>46 <DialogContent className="overflow-hidden p-0">47 <Command className="[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">48 {children}49 </Command>50 </DialogContent>51 </Dialog>52 )53}5455function CommandInput({56 className,57 ...props58}: React.ComponentProps<typeof CommandPrimitive.Input>) {59 return (60 <div61 data-slot="command-input-wrapper"62 className="flex h-9 items-center gap-2 border-b px-3"63 >64 <SearchIcon className="size-4 shrink-0 opacity-50" />65 <CommandPrimitive.Input66 data-slot="command-input"67 className={cn(68 "placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",69 className,70 )}71 {...props}72 />73 </div>74 )75}7677function CommandList({78 className,79 ...props80}: React.ComponentProps<typeof CommandPrimitive.List>) {81 return (82 <CommandPrimitive.List83 data-slot="command-list"84 className={cn(85// … truncated
What it pulls in
npm packages
Files it writes
More from acme
All 49 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | acme | Components | Free | 5 deps · 2 files | |
| alertalert | acme | Components | Free | 4 deps · 2 files | |
| alert-dialogalert-dialog | acme | Components | Free | 6 deps · 3 files | |
| aspect-ratioaspect-ratio | acme | Components | Free | 1 dep | |
| avataravatar | acme | Components | Free | 4 deps · 2 files | |
| badgebadge | acme | Components | Free | 5 deps · 2 files | |
| breadcrumbbreadcrumb | acme | Components | Free | 5 deps · 2 files | |
| buttonbutton | acme | Components | Free | 5 deps · 2 files |
