Command
검색과 빠른 작업을 위한 커맨드 메뉴입니다.
개요
The <Command /> component uses the cmdk component by Dip.
설치
사용법
import {
Command,
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from "@/components/ui/command"<Command className="max-w-sm rounded-lg border">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem>Calendar</CommandItem>
<CommandItem>Search Emoji</CommandItem>
<CommandItem>Calculator</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem>Profile</CommandItem>
<CommandItem>Billing</CommandItem>
<CommandItem>Settings</CommandItem>
</CommandGroup>
</CommandList>
</Command>구성
다음 조합으로 Command:
Command
├── CommandInput
└── CommandList
├── CommandEmpty
├── CommandGroup
│ ├── CommandItem
│ └── CommandItem
├── CommandSeparator
└── CommandGroup
├── CommandItem
└── CommandItem예제
Basic
A simple command menu in a dialog.
Command Palette
Search for a command to run...
Shortcuts
Command Palette
Search for a command to run...
Groups
A command menu with groups, icons and separators.
Command Palette
Search for a command to run...
Scrollable
Scrollable command menu with multiple items.
Command Palette
Search for a command to run...
RTL
RTL 지원을 활성화하려면 RTL 설정 가이드를 참고하세요.
API 참조
cmdk 문서를 참고하세요.