---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Shortcut key

One keyboard key drawn as a small bordered cap inline in hint text, naming a chord with its neighbours, for React and Tailwind CSS. Free, MIT.

Free. Its export: `ShortcutKey`.

## Try it

Pick one key or a pair, or type keys of your own, a space or + between two: the keys sit in the sentence that names them.

Pressing the keys does nothing here: the shortcut key only shows them.

## When to use

- One keyboard key drawn as a small bordered cap inline in hint text, naming a chord with its neighbours.
- Also called: kbd or keyboard key.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Shortcut key on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

```sh
npx shadcn@4.23.1 add @goop/trail-shortcut-key
```

```text
Add the Goop Shortcut key to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { ShortcutKey } from '@/components/ui/goop/shortcut-key';

<ShortcutKey>⌘K</ShortcutKey>
```

- Fits: settings, states: body.
- Also known as: Kbd.
- width, padding, corner, border, text: add no class for these.

## API reference

### Options

- `asChild?: boolean = false` — Render the key's look on the one child element instead of a `kbd`.

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

## Related

- [Prose](/themes/trail/components/prose): A block of running text set for reading, one paragraph or several, for a description, an article or a help page.
- [Code block](/themes/trail/components/code-block): A block of code or a command with a copy button.
- [Inline code](/themes/trail/components/inline-code): A word or short phrase of code inside running text, such as a key or a path.
- [Feature grid](/themes/trail/components/feature-grid): A grid of feature cells, each an icon, a title and a line, for a marketing or a pricing page that lists what a product does.
