Widget Test Fixture Skip to main content

Widget Test Fixture

Exhaustive coverage of every toolkit directive. Not for readers — for regression testing.

Widget Test Fixture

This document exercises every directive, control kind, and code-fence annotation documented in docs/blog/toolkit.md and docs/blog/cheatsheet.md. Each ## section exhibits one category so a failing widget is easy to locate visually. Prose is deliberate filler — lorem ipsum between examples — so pagination and typography render against realistic-looking content.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Standard Markdown

Paragraphs, lists, tables, blockquotes, and other GFM features must render with @tailwindcss/typography polish. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Headings h3

Headings h4

Headings h5
Headings h6

Unordered list:

  • Alpha
  • Beta
  • Gamma

Ordered list:

  1. First
  2. Second
  3. Third

Task list:

  • Done item
  • Pending item

Inline emphasis: italic, bold, strikethrough, inline code, a link, and an image: alt text

Blockquote:

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Table:

Column AColumn BColumn C
alpha1left
beta22centre
gamma333right

Horizontal rule follows:


Footnotes (GFM). The first paragraph below references two1. The second paragraph re-uses the same identifier1, which remark-gfm collapses into one footnote body with multiple back-arrows.

A long tangent2 can live below the article flow without interrupting the sentence. Numeric IDs work too3 — they behave the same as named ones; the rendered superscript is always 1, 2, 3 in document order regardless of how authors label them.

Escape sequences. A backslash before a markdown-active character tells the parser "this is a literal glyph, not syntax". Useful when prose needs to discuss markdown itself or contains characters that would otherwise be interpreted (e.g. leading # in a value, underscores in identifiers like snake_case_name, or asterisks in notation).

  • Asterisks without italic: *literal asterisks*
  • Underscores without emphasis: _not italic_
  • Brackets without a link: [not a link](no url)
  • Tildes without strikethrough: ~~not struck through~~
  • Leading hash without a heading: # not an h1
  • Literal backtick: ` followed by not-inline-code
  • Literal backslash: \ (one slash emitted)

Without the backslash, italic / italic / link / strike / # heading would trigger their normal parsing — so escape is the explicit opt-out.


Text directives (inline)

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.

This paragraph opens with a dropcap directive. Dropcaps elevate the first letter of the enclosing paragraph with a prominent typographic treatment. Nemo enim ipsam voluptatem quia voluptas sit aspernatur.

Press CtrlK to open the command palette, or Shift? for the keyboard-shortcuts overlay. Neque porro quisquam est qui dolorem ipsum quia dolor sit amet.

The DOM is a tree-shaped in-memory representation of the page, and SVG is rendered inline as part of that same tree. Ut enim ad minima veniam.

This sentence contains highlighted text in the middle, because the :mark directive exists for exactly that purpose. Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse.

Block typography

Pullquote

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti.

The best developer-experience improvements feel invisible — you only notice them the moment they disappear.

Josh W. Comeau

Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit.

Glossary

Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet.

viewBox
The internal coordinate system of an SVG, independent of the rendered pixel size.
Bezier curve
A smooth path defined by control points; the mathematical basis for SVG <path> curves.
Stroke-dasharray
A CSS property describing the alternating dash-and-gap pattern along an outline.

Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus.

Block callouts — one per tone

The toolkit defines six callout directives by name (per toolkit.md §3.1), not one :::callout directive with a type= attribute. Each tone has its own directive.

Omnis dolor repellendus autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur.

:::note — neutral blue

:::note with title

:::tip — actionable green

:::warning — amber caution

:::danger — red critical

:::caveat — purple exception

:::aside — muted tangent

Callout with icon override

Compact callout

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus.

Results and outcomes

Outcomes, summaries, and try-it blocks delimit the reader's path through an article. They are semantically distinct from callouts.

Voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae.

4.8×
faster render
4.8×
faster render
4.8×
faster render
4.8×
faster render
First article ships

Layout directives — tabs

Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae.

npm install @oboxsystems/blog-toolkit

Layout directives — grid (columns)

Spec does not define a :::columns directive; the equivalent is :::grid{cols=N gap="..."} per toolkit.md §3.2.

Column one — lorem ipsum dolor sit amet, consectetur adipiscing elit.

Column two — sed do eiusmod tempor incididunt ut labore et dolore magna.

A

B

C

1

2

3

4

Layout directives — other

Before

Old approach, with its limitations.

After

New approach, and why it is better.

Why is it called that?

Details render as <details><summary>…</summary>…</details>. Accepts an optional open attribute to start expanded.

Open by default

This one starts expanded because of the open attribute.

Basics

A wrapped section

:::section groups a chunk of prose with an optional eyebrow label, id, and accent colour.

  1. Install

    npm install the package.

  2. Configure

    Edit the config file.

  3. Ship

    Run npm run build.

This block breaks out past the main column width for a visual pause. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore.

Full-bleed region, edge-to-edge. Use sparingly per toolkit.md §3.2. Full-bleed region, edge-to-edge. Use sparingly per toolkit.md §3.2. Full-bleed region, edge-to-edge. Use sparingly per toolkit.md §3.2. Full-bleed region, edge-to-edge. Use sparingly per toolkit.md §3.2.

Media directives

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Local video (defaults — no autoplay, no loop, audible)

0:00 / 0:00
Default video — autoplay/loop/muted all OFF; reader presses play

Local video — explicit looping-illustration opt-in

0:00 / 0:00
Looping illustration — autoplay loop muted flags set explicitly

Local video — simple mode

Simple mode — only a centred play / pause toggle, no controls bar

YouTube (lite-embed)

YouTube URL — rendered via lite-youtube-embed
Same video via canonical youtube.com URL

Figure

Diagram of a viewBox

A captioned image — caption supports inline Markdown.

SVG embed

Compare slider

Before refactor
Before refactorAfter refactor

External embed

Code fences — metadata variants

Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores.

Language variants — plain

<!doctype html>
<html>
  <body>Hello</body>
</html>
.box { background: tomato; }
<svg viewBox="0 0 10 10"><circle cx="5" cy="5" r="4" /></svg>
export const Box = () => <div className="box">Hi</div>;

Title annotation

example.tsx
export function example() {
  return "hello";
}

Line highlight — range

example.tsx
import { useState } from "react";

function Counter() {
  const [count, setCount] = useState(0);
  return <button onClick={() => setCount(c => c + 1)}>{count}</button>;
}

showLineNumbers + inline-pattern highlight

App.jsx
import { useState } from "react";

export default function App() {
  const [n, setN] = useState(0);
  return <button onClick={() => setN(n + 1)}>{n}</button>;
}

Diff fence

  const greet = (name) => `Hello, ${name}`;
  const greet = (name = "world") => `Hello, ${name}`;

Collapsed fence

Show long-file.js
// Pretend this file is 400 lines long.
function a() {}
function b() {}
function c() {}

Playground — static mode (inline)

Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat.

Static with CSS-variable controls (no JS)

<div class="box"></div>
Static playground driven by CSS custom properties

Static with sibling-folder src

<div class="test-snippet">
  <span class="dot"></span>
  <p>Test snippet works</p>
</div>

Test snippet works

Static playground sourced from ./snippets/example/

Static with bindings — from (direct)

index.html
<svg width="240" height="160">
  <line x1="20" y1="140" x2="220" y2="20"
        stroke="#f39c12" stroke-width="3" />
</svg>
Direct binding — control value goes straight to one attribute

Static with bindings — template (interpolation)

index.html
<svg viewBox="0 0 300 200" width="100%" height="200">
  <rect x="50" y="30" width="200" height="140"
        fill="#9b59b6" fill-opacity="0.2"
        stroke="#9b59b6" stroke-width="3" rx="8" />
</svg>
Template binding — compose multiple controls into one attribute string

Static with bindings — compute (helper expression)

index.html
<svg width="300" height="200">
  <polygon points="150,40 201,70 201,130 150,160 99,130 99,70"
           fill="#1abc9c" fill-opacity="0.2"
           stroke="#1abc9c" stroke-width="2"
           stroke-linejoin="round" />
</svg>
Compute binding — JS expression using toolkit helpers

Playground — vanilla mode (inline)

Accusantium doloremque laudantium, totam rem aperiam eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

Vanilla with inline HTML + CSS + JS

<div id="stage"></div>
Vanilla JS playground — mount(container, controls) contract

Vanilla with sibling-folder src

<div class="test-snippet">
  <span class="dot"></span>
  <p>Test snippet works</p>
</div>
Vanilla playground sourced from ./snippets/example/

Playground — react mode (inline)

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint.

App.jsx
export default function App({ x1, y1, color, animated }) {
  return (
    <svg viewBox="0 0 280 280" width="280" height="280">
      <circle cx={x1} cy={y1} r={40} fill={color}
        style={{ transition: animated ? "all 200ms ease" : "none" }} />
    </svg>
  );
}
React inline — controls arrive as props on the default export

Playground — live mode

A lightweight HTML / CSS / JS editor backed by an iframe srcdoc — no bundler, no JSX, no module resolution. The reader can tweak the source and watch the iframe re-run on every keystroke (debounced ~200ms). Ideal for "edit-this-snippet-and-see-what-happens" demos that don't need React or imports.

Live HTML/CSS/JS editor — tweak any tab to update the iframe

Playground — sandpack mode

Loading sandbox…
Sandpack + React — reader edits the code

Sandpack full layout

Loading sandbox…
Sandpack + vanilla-ts with all three panes

Sandpack sibling-folder form

Loading sandbox…
Sandpack sourced from a sibling folder

Playground — layouts

Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.

layout="preview-only"

index.html
<svg width="120" height="120">
  <circle cx="60" cy="60" r="50" fill="#3498db" />
</svg>
Preview only — no controls, no editor

layout="controls+preview"

<svg width="120" height="120"><circle class="c" cx="60" cy="60" fill="#e74c3c" /></svg>
Controls + preview — no code editor

layout="editor+preview"

Loading sandbox…
Editor + preview — sandpack only

layout="full"

Loading sandbox…
Full — controls + editor + preview

Controls — one example of every v1 kind

Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur.

index.html
<div class="kitchen-sink">All v1 + later controls above.</div>
All v1 + later controls above.
Kitchen-sink — every control kind shipped in v1 (colSpan demo: textarea + xypad span both columns)

Accessibility-focused controls

Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint.

<div class="swatch">Opacity demo</div>
Opacity demo

Alpha channel of the fill colour. 0 = transparent, 1 = opaque.

Select a colour theme.

Controls using description + label

Closing

Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur.

Footnotes

  1. A short footnote. Collected at the bottom of the article, with a link back to the reference point. 2

  2. Footnotes can carry multiple sentences, inline code, links, and even emphasis. They're the right tool when the side-remark would derail the main sentence but still deserves to be said somewhere readable.

  3. Identifier is private to the article. The reader sees auto-numbered superscripts.