Kbd
Kbd 컴포넌트는 주어진 작업을 수행하는 키 또는 키 조합을 표시하는 데 사용됩니다.
언제 사용하나요
- 시각적 키 표현을 통해 키보드 입력을 인식하는 데 사용됩니다.
- 사용자에게 키보드 단축키를 표시할 때.
사용 예시
컴포넌트를 사용하여 키 또는 조합을 나타냅니다.
복사하려면 ⌘ + C 를 누르세요.
astro
---
import Kbd from '@/components/data-display/Kbd.astro';
---
<p>
Press <span class="flex gap-1 items-center"><Kbd>⌘</Kbd> + <Kbd>C</Kbd></span> to copy.
</p> 변형 (Variants)
크기
Kbd 컴포넌트는 `sm`, `md`, `lg`의 다양한 크기를 지원합니다.
Ctrl Ctrl Ctrl
astro
<Kbd size="sm">Ctrl</Kbd>
<Kbd size="md">Ctrl</Kbd>
<Kbd size="lg">Ctrl</Kbd> 의도 (Intents)
Kbd 컴포넌트는 `default`, `outline`, `ghost`의 다양한 시각적 의도를 지원합니다.
Default Outline Ghost
astro
<Kbd intent="default">Default</Kbd>
<Kbd intent="outline">Outline</Kbd>
<Kbd intent="ghost">Ghost</Kbd> API 참조
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| size | Size of the keyboard key. | 'sm' | 'md' | 'lg' | 'md' |
| intent | Visual style of the keyboard key. | 'default' | 'outline' | 'ghost' | 'default' |
| class | Additional CSS classes to apply. | string | - |