Skip to content

Kbd

A quiet native keyboard-input label for keys and shortcut hints.

Preview
Ctrl+K

Use Kbd

Kbd is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
kbd.tsxTSX
"use client";

import { FloodRoot, Kbd } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Kbd>Ctrl</Kbd> + <Kbd>K</Kbd>
    </FloodRoot>
  );
}

Design notes

  • Native kbd markup, not a button or a shortcut handler. The application implements and documents actual bindings.
  • Sizes sm/md/lg use relative keycap tokens. Native props/ref target the kbd element. Available in 0.2.4.

API reference

PropValuesDefault
size"sm" | "md" | "lg""sm"
Native HTML propsHTMLAttributes<HTMLElement>Forwarded
View TypeScript source