- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
- Typography
Installation#
pnpm dlx shadcn@latest add @force-ui-svelte/kbd
Usage#
<script lang="ts">
import * as Kbd from "$lib/components/ui/kbd/index.js";
</script><Kbd.Root>B</Kbd.Root>Composition#
Use the following composition to build Kbd.Root and Kbd.Group:
Kbd.Root
Kbd.Group
├── Kbd.Root
└── Kbd.RootExamples#
Group#
Use the Kbd.Group component to group keyboard keys together.
Button#
Use the Kbd.Root component inside a Button component to display a keyboard key inside a button.
Tooltip#
You can use the Kbd.Root component inside a Tooltip component to display a tooltip with a keyboard key.
Input Group#
You can use the Kbd.Root component inside a InputGroup.Addon component to display a keyboard key inside an input group.
Primary#
Use variant="primary" when placing a Kbd on a solid or brand-coloured surface so the key label remains legible against the background.
RTL#
To enable RTL support in Force UI, see the RTL configuration guide.
API Reference#
Kbd.Root#
Use the Kbd.Root component to display a keyboard key.
| Prop | Type | Default |
|---|---|---|
class | string | `` |
variant | "default" | "primary" | "default" |
<Kbd.Root>Ctrl</Kbd.Root>Kbd.Group#
Use the Kbd.Group component to group Kbd.Root components together.
| Prop | Type | Default |
|---|---|---|
class | string | `` |
<Kbd.Group>
<Kbd.Root>Ctrl</Kbd.Root>
<Kbd.Root>B</Kbd.Root>
</Kbd.Group>