command
draco-china-github/commandFreeComponent
shadcn/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/draco-china/shadcn-pro/main/apps/docs/public/r/styles/radix-sera/command.jsonSource
1"use client"23import * as React from "react"4import { Command as CommandPrimitive } from "cmdk"56import { cn } from "@/registry/radix-sera/lib/utils"7import {8 Dialog,9 DialogContent,10 DialogDescription,11 DialogHeader,12 DialogTitle,13} from "@/registry/radix-sera/ui/dialog"14import {15 InputGroup,16 InputGroupAddon,17} from "@/registry/radix-sera/ui/input-group"18import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"1920function Command({21 className,22 ...props23}: React.ComponentProps<typeof CommandPrimitive>) {24 return (25 <CommandPrimitive26 data-slot="command"27 className={cn(28 "flex size-full flex-col overflow-hidden bg-popover text-popover-foreground",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("top-1/3 translate-y-0 overflow-hidden p-0", className)}57 showCloseButton={showCloseButton}58 >59 {children}60 </DialogContent>61 </Dialog>62 )63}6465function CommandInput({66 className,67 ...props68}: React.ComponentProps<typeof CommandPrimitive.Input>) {69 return (70 <div data-slot="command-input-wrapper" className="p-1">71 <InputGroup className="border-transparent border-b-input bg-transparent px-3">72 <CommandPrimitive.Input73 data-slot="command-input"74 className={cn(75 "w-full px-2 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",76 className77 )}78 {...props}79 />80 <InputGroupAddon>81 <IconPlaceholder82 lucide="SearchIcon"83 tabler="IconSearch"84 hugeicons="SearchIcon"85 phosphor="MagnifyingGlassIcon"86 remixicon="RiSearchLine"87 className="size-3.5 shrink-0 opacity-50"88 />89 </InputGroupAddon>90 </InputGroup>91 </div>92 )93}9495function CommandList({96 className,97 ...props98}: React.ComponentProps<typeof CommandPrimitive.List>) {99 return (100// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from shadcn/ui
All 201 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Free | no deps | |
| alertalert | shadcn/ui | Components | Free | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Free | no deps | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Free | no deps | |
| avataravatar | shadcn/ui | Components | Free | no deps | |
| badgebadge | shadcn/ui | Components | Free | no deps | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Free | no deps | |
| buttonbutton | shadcn/ui | Components | Free | no deps |
