import { WyrdKbd } from "@wyrd-company/react";
<WyrdKbd keys={[{"label":"Enter"}]} />import 'package:wyrd_flutter/wyrd_flutter.dart';
WyrdKbd(
keys: [{"label":"Enter"}],
) data-display — wyrd.component.kbd
Semantic inline presentation of a single key or keyboard shortcut combination.
Install @wyrd-company/react or the Flutter package and use it directly —
your DESIGN.md does the styling.
$schema: https://thewyrdingway.dev/schemas/component-contract.schema.ymlcontractVersion: 0.1.0identity: name: Kbd tag: wyrd-kbd package: wyrd.component.kbd title: Keyboard shortcut summary: Semantic inline presentation of a single key or keyboard shortcut combination.relationships: related-to: - quality-parity-and-gatesclassification: category: data-display composition: collection interactive: falsetarget-strategy: react: required flutter: requiredsurface: properties: - name: keys type: kind: array item: kind: object fields: label: kind: string required: true serializable: true summary: Ordered key labels in the shortcut. - name: separator type: kind: string required: false default: "+" serializable: true summary: Symbol displayed between key labels in a combination. slots: [] events: [] states: - name: default source: platform summary: A single key or key combination. parts: - name: root summary: Semantic keyboard-input root. - name: key summary: Repeated semantic key label. - name: separator summary: Symbol between adjacent keys. tokens: background: color.surface-container foreground: color.on-surface border-color: color.outline radius: rounded.sm text: typography.code-mdmessages: []obligations: accessibility: role: none keyboard: [] semantics: - Web renders a semantic kbd root containing a kbd element for each key label. - The component adds no interactive role or keyboard behavior. - Key labels and separators remain available to accessibility APIs in visual order. behavior: model: stateless interactions: [] hostEffects: [] conditions: - rtl - density-compact - text-expansion sdui: status: serializable serializableProperties: - keys - separator serializableSlots: [] eventBindings: [] notes: Kbd serializes ordered key labels and its separator. It owns no localizable strings; the symbolic default separator is non-linguistic.examples: - name: single-key state: default properties: keys: - label: Enter slots: {} - name: combination state: default properties: keys: - label: Ctrl - label: K slots: {} - name: alternate-separator state: default properties: keys: - label: ⌘ - label: Shift - label: P separator: " " slots: {}
Generated from the contract's examples block.
Previews are the published @wyrd-company/react component, themed by the
brand's role tokens — flip the site's light/dark toggle and they follow.
import { WyrdKbd } from "@wyrd-company/react";
<WyrdKbd keys={[{"label":"Enter"}]} />import 'package:wyrd_flutter/wyrd_flutter.dart';
WyrdKbd(
keys: [{"label":"Enter"}],
) import { WyrdKbd } from "@wyrd-company/react";
<WyrdKbd keys={[{"label":"Ctrl"},{"label":"K"}]} />import 'package:wyrd_flutter/wyrd_flutter.dart';
WyrdKbd(
keys: [{"label":"Ctrl"},{"label":"K"}],
) import { WyrdKbd } from "@wyrd-company/react";
<WyrdKbd keys={[{"label":"⌘"},{"label":"Shift"},{"label":"P"}]} separator=" " />import 'package:wyrd_flutter/wyrd_flutter.dart';
WyrdKbd(
keys: [{"label":"⌘"},{"label":"Shift"},{"label":"P"}],
separator: ' ',
) | Name | Type | Default | Summary |
|---|---|---|---|
keys | array | undefined | Ordered key labels in the shortcut. |
separator | string | + | Symbol displayed between key labels in a combination. |
The contract's token bindings. Open the shared contextual sidebar from any example; primary swatches reflect the color you pick there. Error swatches show the active preset's values; editing any knob switches to custom and resets error to TWW · Ink.
| Binding | Token | |
|---|---|---|
background | color.surface-container | |
foreground | color.on-surface | |
border-color | color.outline | |
radius | rounded.sm | |
text | typography.code-md |
| State | Source | Summary |
|---|---|---|
default | platform | A single key or key combination. |
From the contract's accessibility obligations. Role none
Status: serializable. Kbd serializes ordered key labels and its separator. It owns no localizable strings; the symbolic default separator is non-linguistic.
| Serializable | Members |
|---|---|
| Properties | keys, separator |
| Slots | — |
| Events | — |