검색 가능한 커맨드 팔레트입니다.
이동할 페이지나 실행할 작업을 검색합니다.
function CommandDemo() {
const [open, setOpen] = useState(false)
return (
<>
<Button variant="outline" onClick={() => setOpen(true)}>
명령어 검색
<KbdGroup>
<Kbd>⌘</Kbd>
<Kbd>K</Kbd>
</KbdGroup>
</Button>
<CommandDialog open={open} onOpenChange={setOpen} title="명령어 검색">
<CommandInput placeholder="검색할 명령어를 입력하세요..." />
<CommandList>
<CommandEmpty>일치하는 결과가 없습니다.</CommandEmpty>
<CommandGroup heading="이동">
<CommandItem>내 프로필</CommandItem>
<CommandItem>주문 내역</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</>
)
}