Kbd
Native keyboard shortcut token.
Open search⌘K
Import
Section titled “Import”import { Kbd } from "@pelagornis/page/components";Example
Section titled “Example”The preview above renders this file. Copy it into src/components/ to start from it.
import { Kbd, Stack, Text } from "@pelagornis/page/components";
export default function KbdDemo() { return ( <Stack direction="row" gap="sizeXSmall" align="center"> <Text variant="bodySm" className="text-refineui-alias-foreground-secondary"> Open search </Text> <Kbd>⌘</Kbd> <Kbd>K</Kbd> </Stack> );}Use in MDX
Section titled “Use in MDX”Kbd can be written straight in an .mdx page. Import it below the frontmatter. It renders on the server, so no client directive is needed.
---title: Example---
import { Kbd } from "@pelagornis/page/components";
<span>Open search with <Kbd>⌘</Kbd> <Kbd>K</Kbd></span>Use in Markdoc
Section titled “Use in Markdoc”pageMarkdoc() registers a kbd tag for this component. Add the preset once in markdoc.config.mjs (see Use in Markdoc), then write the tag in any .mdoc page.
Open search with {% kbd %}⌘{% /kbd %} {% kbd %}K{% /kbd %}Attributes use the same names and values as the React props.
Variants
Section titled “Variants”Values the component accepts for each variant prop.
Anatomy
Section titled “Anatomy”Parts of the component and the data-refineui role each one renders.
| Part | Role |
|---|---|
root | kbd |
States
Section titled “States”States the component styles. Component states are exposed as data attributes.
Keyboard
Section titled “Keyboard”Keys the component handles when it has focus.
Reference
Section titled “Reference”- RefineUI · Kbd for design guidance and token detail.
- Use in MDX and Use in Markdoc for the general rules.