Command
tdds/commandFreeComponent
Command palette component
Install it
npx shadcn@latest add https://raw.githubusercontent.com/gjohnsx/ttb-label-verification/main/tdds-registry/public/r/command.jsonSource
1"use client"23import * as React from "react"4import { Command as CommandPrimitive } from "cmdk"56import { cn } from "@/lib/utils"7import {8 Dialog,9 DialogContent,10 DialogDescription,11 DialogHeader,12 DialogTitle,13} from "@/components/ui/dialog"14import {15 InputGroup,16 InputGroupAddon,17} from "@/components/ui/input-group"18import { SearchIcon, CheckIcon } from "lucide-react"1920function Command({21 className,22 ...props23}: React.ComponentProps<typeof CommandPrimitive>) {24 return (25 <CommandPrimitive26 data-slot="command"27 className={cn(28 "bg-popover text-popover-foreground p-1 flex size-full flex-col overflow-hidden",29 className30 )}31 {...props}32 />33 )34}3536function CommandDialog({37 title = "Command Palette",38 description = "Search for a command to run...",39 children,40 className,41 showCloseButton = false,42 ...props43}: React.ComponentProps<typeof Dialog> & {44 title?: string45 description?: string46 className?: string47 showCloseButton?: boolean48}) {49 return (50 <Dialog {...props}>51 <DialogHeader className="sr-only">52 <DialogTitle>{title}</DialogTitle>53 <DialogDescription>{description}</DialogDescription>54 </DialogHeader>55 <DialogContent56 className={cn(57 "top-1/3 translate-y-0 overflow-hidden p-0",58 className59 )}60 showCloseButton={showCloseButton}61 >62 {children}63 </DialogContent>64 </Dialog>65 )66}6768function CommandInput({69 className,70 ...props71}: React.ComponentProps<typeof CommandPrimitive.Input>) {72 return (73 <div data-slot="command-input-wrapper" className="p-1 pb-0">74 <InputGroup className="bg-input/30 border-input/30 h-8! shadow-none! *:data-[slot=input-group-addon]:pl-2!">75 <CommandPrimitive.Input76 data-slot="command-input"77 className={cn(78 "w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",79 className80 )}81 {...props}82 />83 <InputGroupAddon>84 <SearchIcon className="size-4 shrink-0 opacity-50" />85 </InputGroupAddon>86 </InputGroup>87 </div>88 )89}9091function CommandList({92 className,93 ...props94}: React.ComponentProps<typeof CommandPrimitive.List>) {95 return (96 <CommandPrimitive.List97 data-slot="command-list"98 className={cn(99 "no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto",100 className101 )}102 {...props}103 />104// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from tdds
All 43 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | tdds | Components | Free | 2 deps | |
| Alertalert | tdds | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | tdds | Components | Free | 1 dep | |
| Avataravatar | tdds | Components | Free | 1 dep | |
| Badgebadge | tdds | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | tdds | Components | Free | 2 deps | |
| Buttonbutton | tdds | Components | Free | 2 deps | |
| Button Groupbutton-group | tdds | Components | Free | 1 dep |
