{
  "timestamp": "2026-11-19T09:33:56",
  "compiler": {
    "name": "@stencil/core",
    "version": "4.45.4",
    "typescriptVersion": "5.8.3"
  },
  "storybook": "https://magma-design-system.github.io/magma/storybook/",
  "studio": "https://magma-design-system.github.io/magma/studio/",
  "components": [
    {
      "filePath": "src/components/mds-keyboard-key/mds-keyboard-key.tsx",
      "encapsulation": "shadow",
      "tag": "mds-keyboard-key",
      "docs": "",
      "docsTags": [
        {
          "name": "parent",
          "text": "mds-keyboard"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-keyboard-key>` web component renders a single physical-looking keycap inside a [`<mds-keyboard>`](../mds-keyboard/AGENTS.md) parent, supplying the visual unit for one key of a shortcut combination (e.g. the `Ctrl` or `C` in `Ctrl + C`). It has no direct HTML equivalent - it is a presentational glyph whose meaning and test behavior are orchestrated by the parent.\n\n#### Semantic Behavior\n\n- **Compound child only**: It must be a direct slot child of `<mds-keyboard>`; it is not used standalone or mixed with other element types, since the parent reads its `name` to build the key combination and inserts `+` separators between keys.\n- **Glyph resolution from `name`**: When `name` maps to a known icon (arrows, command, shift, enter, tab, space, etc.) it renders that icon; otherwise it renders the key's alias from the dictionary (e.g. `Ctrl`, `Esc`). The `space` key is drawn at least twice as wide as the others.\n- **Keyboard-side indicator**: For the side-specific names (`shiftleft`, `controlright`, ...), it appends an `l` / `r` label.\n- **Pressed state is parent-driven**: The `pressed` prop is toggled by `<mds-keyboard>` during a verification test as the user types; it is not meant to be set manually for presentational use.\n- **Localized title**: The host receives a localized `title` describing the key (el/en/es/it).\n- **No interactive role**: The keycap is purely visual - it exposes no role, focus handling, or emitted events of its own.\n\n#### Properties & Visual Configurations\n\nThis child has essentially no presentational configuration; it does not use the shared `variant` / `tone` ladders from [`agents/variants.md`](../../../../agents/variants.md).\n\n- **`name`** is the only meaningful authoring prop: set it to the canonical key code (one value from the keyboard key dictionary, e.g. `control`, `arrowup`, `c`) for the key this cap represents. It selects the displayed glyph or alias and feeds the parent's combination matching.\n- **`pressed`** is a state hook, not an authoring choice - let the parent set it during a test. Leave it unset for a static shortcut display.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-keyboard-key>` component, ordered from most common to most specialized. The examples assume a working knowledge of the shared component rules in [`agents/conventions.md`](../../../../agents/conventions.md).\n\n#### Single Key Inside `<mds-keyboard>`\n\nAlways nest `<mds-keyboard-key>` inside [`<mds-keyboard>`](../mds-keyboard/AGENTS.md). The parent inserts the `+` separators and wires up key-combination testing; the key is meaningless outside this context.\n\n```html\n<mds-keyboard>\n  <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Multi-Key Shortcut Combination\n\nList every key in the combination as a direct child. The parent inserts `+` separators automatically - do not add them manually.\n\n```html\n<mds-keyboard>\n  <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"s\"></mds-keyboard-key>\n</mds-keyboard>\n\n<mds-keyboard>\n  <mds-keyboard-key name=\"command\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"shift\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"z\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Icon-Resolved Keys\n\nKeys such as arrows, enter, tab, space, command, shift, backspace, and others resolve to an icon automatically. No extra configuration is needed - `name` alone is sufficient.\n\n```html\n<mds-keyboard>\n  <mds-keyboard-key name=\"arrowup\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"enter\"></mds-keyboard-key>\n</mds-keyboard>\n\n<mds-keyboard>\n  <mds-keyboard-key name=\"tab\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"space\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Keyboard-Side Disambiguation\n\nFor keys that exist on both sides of a physical keyboard, use the directional variant (`shiftleft`, `shiftright`, `controlleft`, etc.). The component appends an `l` / `r` indicator to disambiguate.\n\n```html\n<mds-keyboard>\n  <mds-keyboard-key name=\"shiftleft\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"controlleft\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"a\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Interactive Combination Test via `try`\n\nAdd `try` to `<mds-keyboard>` to let users verify they can type the shortcut. The parent drives `pressed` on child keys as the user types - do not set `pressed` yourself in this mode.\n\n```html\n<mds-keyboard try>\n  <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"z\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Styling Customization via CSS Custom Properties\n\nAdjust the keycap only through its public `--mds-keyboard-key-padding` CSS custom property. Set it on the host element or a parent selector; the press animation and the keycap depth come from the component, its text colour from the parent's public `--mds-keyboard-color`.\n\n```css\n/* Increase padding for a larger keycap feel */\n.keycap-large mds-keyboard-key {\n  --mds-keyboard-key-padding: calc(var(--spacing) * 300);\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-keyboard-key>`. Each entry pairs the wrong form with the right one and a one-line reason. System-wide rules (boolean-as-string, shadow piercing, Tailwind color utilities, raw native event listening) live in [`agents/mistakes.md`](../../../../agents/mistakes.md) - they apply here too but are not repeated.\n\n#### Do Not Use `<mds-keyboard-key>` Outside `<mds-keyboard>`\n\nThe key is a compound child component and must be a direct slot child of [`<mds-keyboard>`](../mds-keyboard/AGENTS.md). Used standalone it renders visually but has no separator wiring, no test capability, and violates the compound component contract.\n\n```html\n<!-- INCORRECT -->\n<mds-keyboard-key name=\"control\"></mds-keyboard-key>\n<span>+</span>\n<mds-keyboard-key name=\"c\"></mds-keyboard-key>\n\n<!-- CORRECT -->\n<mds-keyboard>\n  <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"c\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Do Not Add `+` Separators Manually\n\nThe parent `<mds-keyboard>` inserts `+` separators between child keys automatically. Adding them manually results in duplicate or misaligned separators.\n\n```html\n<!-- INCORRECT -->\n<mds-keyboard>\n  <mds-keyboard-key name=\"command\"></mds-keyboard-key>\n  <span>+</span>\n  <mds-keyboard-key name=\"v\"></mds-keyboard-key>\n</mds-keyboard>\n\n<!-- CORRECT -->\n<mds-keyboard>\n  <mds-keyboard-key name=\"command\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"v\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Do Not Set `pressed` Manually When `try` Is Active\n\nWhen `<mds-keyboard try>` is enabled, the parent owns `pressed` and sets it as the user types. Setting it manually conflicts with the parent state machine and produces incorrect visual feedback.\n\n```html\n<!-- INCORRECT -->\n<mds-keyboard try>\n  <mds-keyboard-key name=\"control\" pressed></mds-keyboard-key>\n  <mds-keyboard-key name=\"z\"></mds-keyboard-key>\n</mds-keyboard>\n\n<!-- CORRECT -->\n<mds-keyboard try>\n  <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"z\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Do Not Use a Generic `name` String Outside the Key Dictionary\n\n`name` is a `KeyboardKeyName` union type. Passing an arbitrary string (e.g. `\"ctrl\"`, `\"cmd\"`, `\"esc\"`) that is not in the dictionary causes a runtime lookup failure because the component reads `keyboardKeysData[name]` without a guard.\n\n```html\n<!-- INCORRECT -->\n<mds-keyboard>\n  <mds-keyboard-key name=\"ctrl\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"cmd\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"esc\"></mds-keyboard-key>\n</mds-keyboard>\n\n<!-- CORRECT -->\n<mds-keyboard>\n  <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"command\"></mds-keyboard-key>\n  <mds-keyboard-key name=\"escape\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Do Not Slot Content Inside `<mds-keyboard-key>`\n\n`<mds-keyboard-key>` exposes no default or named slot. Any slotted content is ignored; the glyph is derived entirely from the `name` prop.\n\n```html\n<!-- INCORRECT -->\n<mds-keyboard>\n  <mds-keyboard-key name=\"control\">Ctrl</mds-keyboard-key>\n</mds-keyboard>\n\n<!-- CORRECT -->\n<mds-keyboard>\n  <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Customize via CSS Custom Properties, Not Shadow-Piercing Selectors\n\nThe supported customization surface is the public `--mds-keyboard-key-padding` CSS custom property. Piercing shadow DOM via `::part()` on undocumented internals, `>>>`, or class hacks couples your code to the implementation and will break on minor releases.\n\n```css\n/* INCORRECT */\nmds-keyboard-key >>> .physical-key {\n  background-color: blue;\n}\n\n/* CORRECT */\nmds-keyboard-key {\n  --mds-keyboard-key-padding: calc(var(--spacing) * 300);\n}\n```\n"
      },
      "props": [
        {
          "name": "name",
          "type": "\"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\" | \"a\" | \"alt\" | \"altleft\" | \"altright\" | \"arrowdown\" | \"arrowleft\" | \"arrowright\" | \"arrowup\" | \"b\" | \"backspace\" | \"c\" | \"capslock\" | \"command\" | \"commandleft\" | \"commandright\" | \"control\" | \"controlleft\" | \"controlright\" | \"d\" | \"delete\" | \"e\" | \"end\" | \"enter\" | \"escape\" | \"f\" | \"f1\" | \"f10\" | \"f11\" | \"f12\" | \"f2\" | \"f3\" | \"f4\" | \"f5\" | \"f6\" | \"f7\" | \"f8\" | \"f9\" | \"g\" | \"h\" | \"home\" | \"i\" | \"j\" | \"k\" | \"l\" | \"m\" | \"n\" | \"o\" | \"option\" | \"optionleft\" | \"optionright\" | \"p\" | \"pagedown\" | \"pageup\" | \"q\" | \"r\" | \"s\" | \"shift\" | \"shiftleft\" | \"shiftright\" | \"space\" | \"t\" | \"tab\" | \"u\" | \"v\" | \"w\" | \"windows\" | \"windowsleft\" | \"windowsright\" | \"x\" | \"y\" | \"z\"",
          "complexType": {
            "original": "KeyboardKeyName",
            "resolved": "\"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\" | \"a\" | \"alt\" | \"altleft\" | \"altright\" | \"arrowdown\" | \"arrowleft\" | \"arrowright\" | \"arrowup\" | \"b\" | \"backspace\" | \"c\" | \"capslock\" | \"command\" | \"commandleft\" | \"commandright\" | \"control\" | \"controlleft\" | \"controlright\" | \"d\" | \"delete\" | \"e\" | \"end\" | \"enter\" | \"escape\" | \"f\" | \"f1\" | \"f10\" | \"f11\" | \"f12\" | \"f2\" | \"f3\" | \"f4\" | \"f5\" | \"f6\" | \"f7\" | \"f8\" | \"f9\" | \"g\" | \"h\" | \"home\" | \"i\" | \"j\" | \"k\" | \"l\" | \"m\" | \"n\" | \"o\" | \"option\" | \"optionleft\" | \"optionright\" | \"p\" | \"pagedown\" | \"pageup\" | \"q\" | \"r\" | \"s\" | \"shift\" | \"shiftleft\" | \"shiftright\" | \"space\" | \"t\" | \"tab\" | \"u\" | \"v\" | \"w\" | \"windows\" | \"windowsleft\" | \"windowsright\" | \"x\" | \"y\" | \"z\"",
            "references": {
              "KeyboardKeyName": {
                "location": "import",
                "path": "@type/keyboard",
                "id": "src/type/keyboard.ts::KeyboardKeyName",
                "referenceLocation": "KeyboardKeyName"
              }
            }
          },
          "mutable": false,
          "attr": "name",
          "reflectToAttr": true,
          "docs": "Sets the code of the keyboard key for combination tests if `try` attribute is set from `mds-keyboard` parent component",
          "docsTags": [],
          "values": [
            {
              "value": "0",
              "type": "string"
            },
            {
              "value": "1",
              "type": "string"
            },
            {
              "value": "2",
              "type": "string"
            },
            {
              "value": "3",
              "type": "string"
            },
            {
              "value": "4",
              "type": "string"
            },
            {
              "value": "5",
              "type": "string"
            },
            {
              "value": "6",
              "type": "string"
            },
            {
              "value": "7",
              "type": "string"
            },
            {
              "value": "8",
              "type": "string"
            },
            {
              "value": "9",
              "type": "string"
            },
            {
              "value": "a",
              "type": "string"
            },
            {
              "value": "alt",
              "type": "string"
            },
            {
              "value": "altleft",
              "type": "string"
            },
            {
              "value": "altright",
              "type": "string"
            },
            {
              "value": "arrowdown",
              "type": "string"
            },
            {
              "value": "arrowleft",
              "type": "string"
            },
            {
              "value": "arrowright",
              "type": "string"
            },
            {
              "value": "arrowup",
              "type": "string"
            },
            {
              "value": "b",
              "type": "string"
            },
            {
              "value": "backspace",
              "type": "string"
            },
            {
              "value": "c",
              "type": "string"
            },
            {
              "value": "capslock",
              "type": "string"
            },
            {
              "value": "command",
              "type": "string"
            },
            {
              "value": "commandleft",
              "type": "string"
            },
            {
              "value": "commandright",
              "type": "string"
            },
            {
              "value": "control",
              "type": "string"
            },
            {
              "value": "controlleft",
              "type": "string"
            },
            {
              "value": "controlright",
              "type": "string"
            },
            {
              "value": "d",
              "type": "string"
            },
            {
              "value": "delete",
              "type": "string"
            },
            {
              "value": "e",
              "type": "string"
            },
            {
              "value": "end",
              "type": "string"
            },
            {
              "value": "enter",
              "type": "string"
            },
            {
              "value": "escape",
              "type": "string"
            },
            {
              "value": "f",
              "type": "string"
            },
            {
              "value": "f1",
              "type": "string"
            },
            {
              "value": "f10",
              "type": "string"
            },
            {
              "value": "f11",
              "type": "string"
            },
            {
              "value": "f12",
              "type": "string"
            },
            {
              "value": "f2",
              "type": "string"
            },
            {
              "value": "f3",
              "type": "string"
            },
            {
              "value": "f4",
              "type": "string"
            },
            {
              "value": "f5",
              "type": "string"
            },
            {
              "value": "f6",
              "type": "string"
            },
            {
              "value": "f7",
              "type": "string"
            },
            {
              "value": "f8",
              "type": "string"
            },
            {
              "value": "f9",
              "type": "string"
            },
            {
              "value": "g",
              "type": "string"
            },
            {
              "value": "h",
              "type": "string"
            },
            {
              "value": "home",
              "type": "string"
            },
            {
              "value": "i",
              "type": "string"
            },
            {
              "value": "j",
              "type": "string"
            },
            {
              "value": "k",
              "type": "string"
            },
            {
              "value": "l",
              "type": "string"
            },
            {
              "value": "m",
              "type": "string"
            },
            {
              "value": "n",
              "type": "string"
            },
            {
              "value": "o",
              "type": "string"
            },
            {
              "value": "option",
              "type": "string"
            },
            {
              "value": "optionleft",
              "type": "string"
            },
            {
              "value": "optionright",
              "type": "string"
            },
            {
              "value": "p",
              "type": "string"
            },
            {
              "value": "pagedown",
              "type": "string"
            },
            {
              "value": "pageup",
              "type": "string"
            },
            {
              "value": "q",
              "type": "string"
            },
            {
              "value": "r",
              "type": "string"
            },
            {
              "value": "s",
              "type": "string"
            },
            {
              "value": "shift",
              "type": "string"
            },
            {
              "value": "shiftleft",
              "type": "string"
            },
            {
              "value": "shiftright",
              "type": "string"
            },
            {
              "value": "space",
              "type": "string"
            },
            {
              "value": "t",
              "type": "string"
            },
            {
              "value": "tab",
              "type": "string"
            },
            {
              "value": "u",
              "type": "string"
            },
            {
              "value": "v",
              "type": "string"
            },
            {
              "value": "w",
              "type": "string"
            },
            {
              "value": "windows",
              "type": "string"
            },
            {
              "value": "windowsleft",
              "type": "string"
            },
            {
              "value": "windowsright",
              "type": "string"
            },
            {
              "value": "x",
              "type": "string"
            },
            {
              "value": "y",
              "type": "string"
            },
            {
              "value": "z",
              "type": "string"
            }
          ],
          "optional": false,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "pressed",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "pressed",
          "reflectToAttr": true,
          "docs": "Sets if the key is pressed or not",
          "docsTags": [],
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-keyboard-key-illumination-dark",
          "annotation": "prop",
          "docs": "Set the dark illumination of the keyboard key.",
          "visibility": "internal"
        },
        {
          "name": "--mds-keyboard-key-illumination-dark-size",
          "annotation": "prop",
          "docs": "Set the size of the dark illumination of the keyboard key.",
          "visibility": "internal"
        },
        {
          "name": "--mds-keyboard-key-illumination-light",
          "annotation": "prop",
          "docs": "Set the light illumination of the keyboard key.",
          "visibility": "internal"
        },
        {
          "name": "--mds-keyboard-key-illumination-light-size",
          "annotation": "prop",
          "docs": "Set the size of the light illumination of the keyboard key.",
          "visibility": "internal"
        },
        {
          "name": "--mds-keyboard-key-padding",
          "annotation": "prop",
          "docs": "Set the padding of the keyboard key.",
          "visibility": "public"
        },
        {
          "name": "--mds-keyboard-key-transition-duration",
          "annotation": "prop",
          "docs": "Set the transition duration of the keyboard key.",
          "visibility": "internal"
        }
      ],
      "slots": [],
      "parts": [],
      "states": [],
      "dependents": [],
      "dependencies": [
        "mds-icon",
        "mds-text"
      ],
      "dependencyGraph": {
        "mds-keyboard-key": [
          "mds-icon",
          "mds-text"
        ]
      },
      "storybook": "ui-keyboard-key--docs"
    }
  ]
}
