Kbd

Displays a keyboard key or shortcut. Use it in instructions and menus to communicate available keyboard actions.

React

Ready

Figma

React examples

Default

EscEnter⌘KCtrlShiftM
import { Kbd, KbdGroup, Stack } from "@kela-systems/ui-components";

export default function KbdDefault() {
  return (
    <Stack direction="row" gap={4} align="center" wrap>
      <Kbd>Esc</Kbd>
      <Kbd variant="primary">Enter</Kbd>
      <KbdGroup>
        <Kbd>⌘</Kbd>
        <Kbd>K</Kbd>
      </KbdGroup>
      <KbdGroup separated>
        <Kbd>Ctrl</Kbd>
        <Kbd>Shift</Kbd>
        <Kbd>M</Kbd>
      </KbdGroup>
    </Stack>
  );
}

Props

Kbd

NameDefaultDescription
variant
"default" | "primary"
"default"

It also takes the attributes of the HTML element it renders.

KbdGroup

NameDefaultDescription
separated
boolean
falseJoins the keys with a "+" separator, e.g. Ctrl + Alt + Shift + B.

It also takes the attributes of the HTML element it renders.

Also exported: kbdVariants (variants).

Read this page as Markdown

Search ARK

Find a page, a primitive or a component.