Kbd

A keyboard key or shortcut hint.

Status: stable. Category: Data display.

import { Kbd } from '@glyphui/ui'

Exports: Kbd, kbdStyles.

Example: Shortcuts

import { Kbd, Text } from '@glyphui/ui'

export default function Example() {
  return (
    <div className="grid gap-2">
      <Text size="small">
        Open the command menu with <Kbd>⌘</Kbd> <Kbd>K</Kbd>
      </Text>
      <Text size="small">
        Save with <Kbd>Ctrl</Kbd> + <Kbd>S</Kbd>
      </Text>
    </div>
  )
}

Example: Inside an input

import { Input, Kbd } from '@glyphui/ui'
import { Search } from 'lucide-react'

export default function Example() {
  return (
    <Input
      aria-label="Search docs"
      placeholder="Search docs"
      prefix={<Search />}
      suffix={<Kbd>/</Kbd>}
      className="max-w-xs"
    />
  )
}

Live page: https://glyphui.xyz/components/kbd