# Kbd

Keyboard keys, single or grouped, as shown in menus and shortcuts.

- Registry name: `kbd` (`@candor/kbd`)
- Tier: Pro. Installing it needs a Pro, Premium or Team licence key: the person runs `npx candor-ui key <key>` themselves; never ask for the key in chat or write it to a file.
- Docs: https://candor.themethodic.com/docs/kbd

## Install

```bash
npx candor-ui add kbd
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/kbd`.
It brings in: utils.

## Example

```tsx
"use client"

import { Kbd, KbdGroup } from "@/components/ui/kbd"

export default function Example() {
  return (
    <div className="flex flex-col gap-2 text-sm text-muted-foreground">
      <p>
        Search repositories, tables and flags with{" "}
        <KbdGroup>
          <Kbd>⌘</Kbd>
          <Kbd>K</Kbd>
        </KbdGroup>
      </p>
      <p>
        Send your message with <Kbd>Enter</Kbd>; add a line with{" "}
        <KbdGroup>
          <Kbd>Shift</Kbd>
          <Kbd>Enter</Kbd>
        </KbdGroup>
      </p>
    </div>
  )
}
```

## <Kbd>

No props.

Also takes the props of `React.ComponentProps<"kbd">`.

## <KbdGroup>

No props.

Also takes the props of `React.ComponentProps<"kbd">`.

## Rules for using Candor UI

- Components take plain typed data. Never pass model output as HTML or render it as a link; messages are typed blocks.
- A control that can't be used says why: wrap it in `<Locked reason="…">`, don't just disable it.
- Don't show a value you don't have: leave it out (it renders as —) rather than guess. An estimate is labelled as one.
- Nothing is pre-selected in a decision a person makes, and the agent is named from your app's data, never from model output.
- Your app's words go in `LocaleProvider` (fixed strings) and `TermsProvider` (nouns); entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
