← Omnes specs UI

Contractus componentis

code-block

Codicis capsa cum titulo linguae et button ad exscribendum insito.

Versio
v1.0.0

Props

NomenGenusValoresPraefinitum
codestring——
languagestring—bash

Tokens

colors
interactive.button.focus
font
primitive.font.family

Aditus

native_element
div (container) with an inner button for copy-to-clipboard
keyboard
["Enter/Space activates the copy button (native)"]
notes
code content is text-only, no ARIA needed. The copy button uses a native <button> so screen readers announce it correctly. There is no live region — the 'copied' visual state (1.4s timeout) is not announced. Add an aria-live region if that becomes a real user need.
JSON probatum crudum
{
  "name": "code-block",
  "version": "1.0.0",
  "props": {
    "code": {
      "type": "string"
    },
    "language": {
      "type": "string",
      "default": "bash"
    }
  },
  "tokens_used": {
    "font": [
      "primitive.font.family"
    ],
    "colors": [
      "interactive.button.focus"
    ]
  },
  "a11y": {
    "native_element": "div (container) with an inner button for copy-to-clipboard",
    "keyboard": [
      "Enter/Space activates the copy button (native)"
    ],
    "notes": "code content is text-only, no ARIA needed. The copy button uses a native <button> so screen readers announce it correctly. There is no live region — the 'copied' visual state (1.4s timeout) is not announced. Add an aria-live region if that becomes a real user need."
  }
}
ChiralFM