Pattern library

UI Patterns

A UI pattern library built for coding agents. 40 patterns, each shipping a copy-paste prompt that rebuilds it inside your own codebase — plus a live preview and the source behind it.

A blueprint drawing of interface parts: dialled gauges, dimensioned panels, and a grid of repeated tiles

How it works

Every pattern, three ways

1. Preview

The pattern running live in an isolated frame, in whichever theme you are reading in.

2. Source

Its markup, styles and behaviour, plus a single runnable file carrying its own palette.

3. Prompt

A written spec that rebuilds the pattern from scratch — including why each decision is the way it is. Paste it into Claude Code, Cursor, or any coding agent.

The prompts are the point. Each one is written to survive being handed to an agent with no other context: it names the surfaces the pattern belongs on, spells out the constraint that makes it work, and calls out the failure it exists to prevent. Nothing here is a dependency you install.

40 patterns

  • Data display · Added

    Windowed schedule grid

    Rows of resources against a fixed time window, where each block is sized by its overlap with the window rather than by its own duration.

    scheduletimelinegridflexboxtime
  • Data display · Added

    Benchmark progress bar

    Places a raw figure on a scale of external benchmarks instead of printing it plain.

    progressbenchmarkscss-onlydata-vizempty-state
  • Data display · Added

    Cross-highlight matrix

    A two-axis lookup table with both headers sticky, hover lighting the full row and column at once, and a durable click-to-pin selection for touch.

    tablematrixstickyaccessibilityhover
  • Data display · Added

    Left-truncating paths

    Shortens a long path by dropping whole segments from the left, because the tail is what tells two paths apart.

    truncationpathstext-overflowbreadcrumbsfile-systems
  • Data display · Added

    Shape-mark sequenceUpdated

    A sequence compressed into a row of small marks whose shape carries the state.

    steppersparklineseriestruncationcss-onlyno-assets
  • Data display · Added

    Linked month bars

    A month-by-month volume timeline built from plain divs where every aggregate row links to the filtered view that produced it.

    timelinedrill-downcss-onlydata-vizno-assets
  • Data display · Added

    Glass vial meter

    A vertical potion-vial meter whose liquid fills a wide bulb first and then rises into a narrow neck — all CSS, no images.

    meterskeuomorphiccss-onlyreduced-motionno-assets
  • Data display · Added

    Partitioned stage bar

    Progress for work with several possible endings, drawn as a census rather than a fraction.

    progressstacked-barbatchlegendstatusaria-label
  • Data display · Added

    Term-by-term derivation

    A computed figure shown with the audit trail behind it — the number is the product and the derivation is the receipt.

    explainabilitycalculatordisclosureformulatabular-numsdetails
  • Data display · Added

    Plan preview treeUpdated

    A dry run shown as a before-and-after tree with counts now, after, and the difference.

    dry-rundifftreepreviewbulk-operationconfirmation
  • Data display · Added

    Uniform slot shell

    One card shell many independent sources render through, where the shell does the capping.

    dashboardwidgetscardsempty-stateerror-stategrid
  • Layout · Added

    Object-shaped cardsUpdated

    Where a record stands for a physical thing, the card is drawn as that thing — nine variations in pure gradients.

    cardscss-onlygradientsvariationsno-assetsskeuomorphic
  • Layout · Added

    Adaptive tile mosaic

    A container with no artwork draws one from up to four member tiles, grid tracks following tile count.

    css-gridcss-onlyno-assetscardslayout
  • Layout · Added

    Ground-scrimmed artworkUpdated

    Text printed over unreviewed artwork, scrimmed to an alpha that can be written down rather than guessed.

    layoutcss-onlygradientscontrastno-assetsherocards
  • Layout · Added

    Hairline stat stripUpdated

    Stat tiles joined by hairlines that are grid gap, not borders.

    statscss-gridcss-onlyhairlineno-assets
  • Layout · Added

    Annotated transcript

    Conversation bubbles with a speaker-colored spine and a fixed metadata gutter.

    conversationgutterstatus-rolescontrastcss-only
  • Layout · Added

    Cork notice board

    Pinned paper notes on a cork board where every texture is layered CSS gradients.

    skeuomorphicgradientsno-assetscardscss-only
  • Layout · Added

    Hotspot marker layerUpdated

    Markers at percentage coordinates over a fixed-aspect picture, turning into a list when too narrow.

    hotspotspointer-eventsaspect-ratiocontainer-queryoverlayresponsive
  • Layout · Added

    Line-art empty states

    Inline drawings for empty surfaces stroked in the inherited text colour.

    empty-statesvgcurrentcolorillustrationaria-hiddenno-assets
  • Layout · Added

    Column-flow wall

    Cards flowing down columns instead of across rows, with the reading-order cost stated plainly.

    masonrycolumnsbreak-insidereading-ordercardsresponsive
  • Interaction · Added

    Scroll edge shadows

    An inset shadow shown only on the edge that has more content behind it.

    scrollingaffordancelistsoverflowprogressive-disclosure
  • Interaction · Added

    Frozen-batch deck

    A one-card-at-a-time review queue whose batch is snapshotted at mount.

    queuereview-flowanimationkeyboardreduced-motion
  • Interaction · Added

    Controls beside the anchorUpdated

    Per-card controls over a fully-linked card without nesting interactive elements in the anchor.

    cardsaccessibilitykeyboardfocus-withingrid
  • Interaction · Added

    Pluggable canvas visualizerUpdated

    One canvas, a registry of draw modes, each mode owning its entire frame.

    canvasvisualizationregistryanimationreduced-motion
  • Interaction · Added

    Roving-grid boardUpdated

    A dense grid of state cells that is one tab stop with arrow-key navigation.

    keyboardroving-tabindexaccessibilitystatesdense-data
  • Interaction · Added

    Section rail

    Sticky vertical rail on wide screens, wrapping tab row on narrow ones, from the same markup.

    navigationtocresponsivearia-currentintersection-observercontainer-queriessticky
  • Interaction · Added

    Ledge-press buttons

    Buttons on a solid ledge shadow that travel down onto it when pressed.

    buttonsskeuomorphicpresstokenscss-only
  • Interaction · Added

    Guarded controlUpdated

    A blocked control stays focusable, carries the reason as text, and refuses in its handler.

    aria-disableddisabledpreconditionskeyboardaria-describedbyforms
  • Interaction · Added

    Polled job cardUpdated

    One card for every state a background job passes through.

    progresspollingbackground-jobindeterminatearia-busyreduced-motion
  • Interaction · Added

    Entry-transform motion

    FLIP-style motion between two rendered states when the old DOM is already gone.

    animationtransitionsreflowreduced-motionnavigationlayout-effect
  • Interaction · Added

    Slot-first pickerUpdated

    Assignment that starts at the destination slot, then narrows the catalogue.

    assignmentpickeraria-pressedfilteringformsdata-driven
  • Forms · Added

    Undo toast

    A destructive action with no confirm dialog, held behind a toast and committed when it expires.

    undotoastdestructivearia-livereduced-motion
  • Forms · Added

    Blast-radius confirmNew

    A confirm dialog that names everything a delete cascades and blocks dismissal while it runs.

    confirm-dialogdestructivecascadedialog-elementforms
  • Forms · Added

    Batch action barUpdated

    A bar that exists only while something is selected, states the count in words, caps at five actions.

    selectionbulk-actionstoolbarcheckboxindeterminatebulk-editmixed-values
  • Forms · Added

    Filtered to zero

    The three empty states a list actually has, written as three different screens.

    empty-statefiltersearchzero-resultsaria-livecopywriting
  • Forms · Added

    Parsed query chips

    A search box that echoes back how it read the text as removable chips.

    searchquery-syntaxchipsfacetsparsingaria-live
  • Forms · Added

    Compound-value picker

    One grouped select whose value carries both the kind and the id.

    selectoptgrouppolymorphicformsdependent-fieldskeyboard
  • Color · Added

    Ground-referenced colorUpdated

    Colors solved against the page's own ground token so they invert correctly between themes.

    colorcontrastcolor-mixaccessibilitywcagthemingyear-map
  • Color · Added

    Single-property color variantsUpdated

    One custom property carries the hue; border, fill, spine and dot derive from it.

    colorcolor-mixcustom-propertiesthemingdata-attributesbadges
  • Color · Added

    Controls on an unknown fillUpdated

    Opaque controls, a gradient-darkened fill, and a two-tone focus ring on a surface whose colour arrives from outside.

    contrastbrand-colorfocus-ringopacitywcagtheming

Your reading desk

Reading settings

No single setting suits every reader. The defaults come from reading research; change anything and the whole site follows. Your choices stay in this browser.

I build with AI and write about what I learn. Twenty years of software, written down so the next person has an easier time.

Text size

The British Dyslexia Association recommends 16 to 19px body text. The default here is 20px.

Line spacing

1.5 is the style-guide floor. Extra space between lines keeps your eye on the right line.

Letter spacing

Wider letter spacing reduces crowding. In one study, children with dyslexia read about 20% faster with it and made half as many errors (Zorzi et al., 2012).

Line length

Characters per line in the main text column.

Typeface

Plain, upright sans serifs did best in an eye-tracking study of 48 readers with dyslexia (Rello & Baeza-Yates, 2013).

Page tint

Pure white can glare. Pick the tint that is easiest on your eyes. Tints apply to the light theme.

Theme
Reading ruler

A tinted band that follows your pointer, like a card held under the line you're reading.