Files
upstream-shadcn-ui/apps/v4/examples/aria/command-shortcuts.tsx
upstream-mirror 1416db152c
All checks were successful
Release / Create Version PR or Publish Stable Release (push) Has been skipped
Release / Publish Prerelease to NPM (push) Has been skipped
Monitor Registries / Monitor registry health (push) Has been skipped
snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
2026-09-15 22:44:43 +05:00

57 lines
1.6 KiB
TypeScript

"use client"
import * as React from "react"
import { CreditCardIcon, SettingsIcon, UserIcon } from "lucide-react"
import { Button } from "@/styles/aria-nova/ui/button"
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandShortcut,
} from "@/styles/aria-nova/ui/command"
export function CommandWithShortcuts() {
const [open, setOpen] = React.useState(false)
return (
<div className="flex flex-col gap-4">
<Button onClick={() => setOpen(true)} variant="outline" className="w-fit">
Open Menu
</Button>
<CommandDialog open={open} onOpenChange={setOpen}>
<Command>
<CommandInput placeholder="Type a command or search..." />
<CommandList
renderEmptyState={() => (
<CommandEmpty>No results found.</CommandEmpty>
)}
>
<CommandGroup heading="Settings">
<CommandItem textValue="Profile">
<UserIcon />
<span>Profile</span>
<CommandShortcut>⌘P</CommandShortcut>
</CommandItem>
<CommandItem textValue="Billing">
<CreditCardIcon />
<span>Billing</span>
<CommandShortcut>⌘B</CommandShortcut>
</CommandItem>
<CommandItem textValue="Settings">
<SettingsIcon />
<span>Settings</span>
<CommandShortcut>⌘S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
</CommandDialog>
</div>
)
}