CommandDialogDemo() — ui Function Reference
Architecture documentation for the CommandDialogDemo() function in command-dialog.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 9b90f096_93de_7ad1_0a71_3c4f6ceafcf6["CommandDialogDemo()"] ace31dd1_9dca_e717_f3fd_248b624989f1["command-dialog.tsx"] 9b90f096_93de_7ad1_0a71_3c4f6ceafcf6 -->|defined in| ace31dd1_9dca_e717_f3fd_248b624989f1 style 9b90f096_93de_7ad1_0a71_3c4f6ceafcf6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
deprecated/www/registry/new-york/examples/command-dialog.tsx lines 24–87
export default function CommandDialogDemo() {
const [open, setOpen] = React.useState(false)
React.useEffect(() => {
const down = (e: KeyboardEvent) => {
if (e.key === "j" && (e.metaKey || e.ctrlKey)) {
e.preventDefault()
setOpen((open) => !open)
}
}
document.addEventListener("keydown", down)
return () => document.removeEventListener("keydown", down)
}, [])
return (
<>
<p className="text-sm text-muted-foreground">
Press{" "}
<kbd className="pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100">
<span className="text-xs">⌘</span>J
</kbd>
</p>
<CommandDialog open={open} onOpenChange={setOpen}>
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem>
<Calendar />
<span>Calendar</span>
</CommandItem>
<CommandItem>
<Smile />
<span>Search Emoji</span>
</CommandItem>
<CommandItem>
<Calculator />
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem>
<User />
<span>Profile</span>
<CommandShortcut>⌘P</CommandShortcut>
</CommandItem>
<CommandItem>
<CreditCard />
<span>Billing</span>
<CommandShortcut>⌘B</CommandShortcut>
</CommandItem>
<CommandItem>
<Settings />
<span>Settings</span>
<CommandShortcut>⌘S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</>
)
}
Domain
Subdomains
Source
Frequently Asked Questions
What does CommandDialogDemo() do?
CommandDialogDemo() is a function in the ui codebase, defined in deprecated/www/registry/new-york/examples/command-dialog.tsx.
Where is CommandDialogDemo() defined?
CommandDialogDemo() is defined in deprecated/www/registry/new-york/examples/command-dialog.tsx at line 24.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free