Files
siakad/.claude/skills/hallmark/references/macrostructures/21-component-playground.md
T
2026-10-24 11:45:32 +07:00

1.3 KiB

21 · Component Playground

Interactive code-and-preview blocks are the page's primary content. Each block previews a thing and shows how to copy it.

  • Heading: each category is a real <h2> ("Buttons", "Forms", "Cards") in the display face, sentence case; never a label band.
  • Body: a preview, then its code, block after block, often with a tab row to switch frameworks; the row scrolls sideways under 60rem.
  • Divider: a change of paper per category; hairlines between examples.
  • Button: a "Copy" button on every code block; its label swaps to "Copied", never a toast (16).
  • Image: the previews are the imagery; one photograph band of the real machines or setting at most.
  • Reveal: none.

Reach for it for design systems, component libraries, snippet sites, framework documentation.

Avoid for marketing pages. Playground is utility, not pitch.

Mono is legal here only inside the code blocks (64); tab labels and captions stay in the body face.

Sample opening lines (tangible: open on a real example, not a claim):

"Try it inline. Then take it home." Two short imperatives. "Every example is editable. Every output is real." Pairs the claim with its proof. "From npm install to your first chart in eight lines." Names the step count, makes a concrete promise.