staff engineerantjanus
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.

Every pattern, three ways

Preview

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

Source

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

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

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.

Good for schedule, timeline, grid

Added 2026-08-11

Data display

Benchmark progress bar

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

Good for progress, benchmarks, css-only

Added 2026-08-11

Data display

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.

Good for table, matrix, sticky

Added 2026-08-11

Data display

Left-truncating paths

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

Good for truncation, paths, text-overflow

Added 2026-08-11

Data displayUpdated

Shape-mark sequence

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

Good for stepper, sparkline, series

Updated 2026-08-21

Data display

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.

Good for timeline, drill-down, css-only

Added 2026-08-21

Data display

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.

Good for meter, skeuomorphic, css-only

Added 2026-08-21

Data display

Partitioned stage bar

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

Good for progress, stacked-bar, batch

Added 2026-09-12

Data display

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.

Good for explainability, calculator, disclosure

Added 2026-09-12

Data displayUpdated

Plan preview tree

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

Good for dry-run, diff, tree

Updated 2026-09-12

Data display

Uniform slot shell

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

Good for dashboard, widgets, cards

Added 2026-09-12

LayoutUpdated

Object-shaped cards

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

Good for cards, css-only, gradients

Updated 2026-08-11

Layout

Adaptive tile mosaic

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

Good for css-grid, css-only, no-assets

Added 2026-08-11

LayoutUpdated

Ground-scrimmed artwork

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

Good for layout, css-only, gradients

Updated 2026-08-11

LayoutUpdated

Hairline stat strip

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

Good for stats, css-grid, css-only

Updated 2026-08-21

Layout

Annotated transcript

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

Good for conversation, gutter, status-roles

Added 2026-08-21

Layout

Cork notice board

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

Good for skeuomorphic, gradients, no-assets

Added 2026-08-21

LayoutUpdated

Hotspot marker layer

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

Good for hotspots, pointer-events, aspect-ratio

Updated 2026-09-12

Layout

Line-art empty states

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

Good for empty-state, svg, currentcolor

Added 2026-09-12

Layout

Column-flow wall

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

Good for masonry, columns, break-inside

Added 2026-09-12

Interaction

Scroll edge shadows

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

Good for scrolling, affordance, lists

Added 2026-08-11

Interaction

Frozen-batch deck

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

Good for queue, review-flow, animation

Added 2026-08-11

InteractionUpdated

Controls beside the anchor

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

Good for cards, accessibility, keyboard

Updated 2026-08-11

InteractionUpdated

Pluggable canvas visualizer

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

Good for canvas, visualization, registry

Updated 2026-08-11

InteractionUpdated

Roving-grid board

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

Good for keyboard, roving-tabindex, accessibility

Updated 2026-08-21

Interaction

Section rail

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

Good for navigation, toc, responsive

Added 2026-08-21

Interaction

Ledge-press buttons

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

Good for buttons, skeuomorphic, press

Added 2026-08-21

InteractionUpdated

Guarded control

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

Good for aria-disabled, disabled, preconditions

Updated 2026-09-12

InteractionUpdated

Polled job card

One card for every state a background job passes through.

Good for progress, polling, background-job

Updated 2026-09-12

Interaction

Entry-transform motion

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

Good for animation, transitions, reflow

Added 2026-09-12

InteractionUpdated

Slot-first picker

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

Good for assignment, picker, aria-pressed

Updated 2026-09-12

Forms

Undo toast

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

Good for undo, toast, destructive

Added 2026-08-28

FormsNew

Blast-radius confirm

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

Good for confirm-dialog, destructive, cascade

Added 2026-09-28

FormsUpdated

Batch action bar

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

Good for selection, bulk-actions, toolbar

Updated 2026-08-28

Forms

Filtered to zero

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

Good for empty-state, filter, search

Added 2026-09-12

Forms

Parsed query chips

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

Good for search, query-syntax, chips

Added 2026-09-12

Forms

Compound-value picker

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

Good for select, optgroup, polymorphic

Added 2026-09-12

ColorUpdated

Ground-referenced color

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

Good for color, contrast, color-mix

Updated 2026-08-11

ColorUpdated

Single-property color variants

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

Good for color, color-mix, custom-properties

Updated 2026-08-21

ColorUpdated

Controls on an unknown fill

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

Good for contrast, brand-color, focus-ring

Updated 2026-09-12