Display shortcuts or keyboard hints as compact keycaps.

How to use

Use Kbd to display a key or shortcut hint. It does not register shortcuts; the component or page that owns the action handles the keyboard event.

  • children represents the key label only. variant chooses an outlined or filled appearance.

  • Place the shortcut hint beside its action. Register the shortcut in the page or component that owns that action.

  • When several keys form one shortcut, use Frame singleLine to keep them on one line with at least 4 CSS px between them. An outer horizontal ScrollArea retains the complete keys in very narrow containers.

Import

import { Kbd } from '@snowui-design-system/components';

Usage

Search shortcut

API Reference

Property Type Default Example Description
variant "border" | "solid" "border" variant="border" Appearance A with an outline or appearance B with a filled background.
children Snippet — <Kbd>Content</Kbd> Key label content.
No data