command
showcase-elevenlabs/commandFreeComponent
shadcn/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/elevenlabs/showcase/main/apps/www/public/r/styles/new-york/command.jsonSource
1"use client"23import * as React from "react"4import { type DialogProps } from "@radix-ui/react-dialog"5import { Command as CommandPrimitive } from "cmdk"6import { Search } from "lucide-react"78import { cn } from "@/lib/utils"9import { Dialog, DialogContent } from "@/registry/new-york/ui/dialog"1011const Command = React.forwardRef<12 React.ElementRef<typeof CommandPrimitive>,13 React.ComponentPropsWithoutRef<typeof CommandPrimitive>14>(({ className, ...props }, ref) => (15 <CommandPrimitive16 ref={ref}17 className={cn(18 "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",19 className20 )}21 {...props}22 />23))24Command.displayName = CommandPrimitive.displayName2526const CommandDialog = ({ children, ...props }: DialogProps) => {27 return (28 <Dialog {...props}>29 <DialogContent className="overflow-hidden p-0">30 <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[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">31 {children}32 </Command>33 </DialogContent>34 </Dialog>35 )36}3738const CommandInput = React.forwardRef<39 React.ElementRef<typeof CommandPrimitive.Input>,40 React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>41>(({ className, ...props }, ref) => (42 <div className="flex items-center border-b px-3" cmdk-input-wrapper="">43 <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />44 <CommandPrimitive.Input45 ref={ref}46 className={cn(47 "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",48 className49 )}50 {...props}51 />52 </div>53))5455CommandInput.displayName = CommandPrimitive.Input.displayName5657const CommandList = React.forwardRef<58 React.ElementRef<typeof CommandPrimitive.List>,59 React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>60>(({ className, ...props }, ref) => (61 <CommandPrimitive.List62 ref={ref}63 className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}64 {...props}65 />66))6768CommandList.displayName = CommandPrimitive.List.displayName6970const CommandEmpty = React.forwardRef<71// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from shadcn/ui
All 357 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Free | 1 dep | |
| alertalert | shadcn/ui | Components | Free | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Free | 1 dep | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Free | 1 dep | |
| avataravatar | shadcn/ui | Components | Free | 1 dep | |
| badgebadge | shadcn/ui | Components | Free | 1 dep | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Free | 1 dep | |
| buttonbutton | shadcn/ui | Components | Free | 1 dep |
