Skip to content
BigBang

Popular

    ↑↓Navigate↵OpenEscClose
    TR

    Components

    Kbd

    Shows a keyboard key or shortcut.

    Storybook
    Storybook
    Source
    Source

    Kbd shows a shortcut or a key to press: in menu items, tooltips and help text.

    • To show code or a command: Use the code text style.
    • As a clickable element: Kbd is not interactive; use a Button.
    • As a placeholder when there is no shortcut: Do not draw an empty key.
    ControlK
    import { Kbd, Provider } from '@bigbang/ui';
    export default function Default() {
    return (
    <Provider locale="en-GB">
    <Kbd keys={['mod', 'K']} />
    </Provider>
    );
    }
    1. Key: an inner <kbd>; a flat key on a muted fill, without a border.
    2. Separator: a visual + between keys; screen readers skip it.
    3. Container: the outer <kbd> around the combination.
    • mod, ctrl, shift, alt, enter, escape, tab, backspace and the four arrows are named.
    • Any other text (K, F2) shows and is read as written.
    • The platform is detected in the browser; the server renders other. Fix it with platform.
    • On keys that show a symbol, the symbol is hidden and visually hidden text carries the name.
    • Give the keys in press order: modifiers first.
    • Write letters in capitals: K, S.
    • Show at most one shortcut per item.
    • The spoken names of named keys are library strings.
    Turkish English
    Komut Command
    Yukarı ok Up arrow
    Sekme Tab
    • Tooltip: shows the shortcut in a tooltip.
    • Button: an action that has a shortcut.