Skip to content
Design system

Inputs

Text, numbers, selects, sliders, color, files, and structured editors.

Inputs

Text entry controls compose from Field (label, helper, error) and InputGroup (addons, inline actions). Size matches Button / NumberField: xs = 24px, sm = 28px, default = 32px. Pass size when an input shares a row with other controls; leave it default in labeled Field stacks.

Text input states

Field pairs a label with helper or error text. aria-invalid drives the destructive border and ring automatically — no extra className needed.

Shown in the sidebar and tab title.

Filled with a generated default.

Disabled while a dependent step runs.

Read-only — copy it, don't edit it.

Input group

InputGroup handles addons — icons, inline buttons, prefixes, and units — inside a single bordered control.

https://
px

Textarea

Number field

NumberField wraps a stepper with min/max clamping. Invalid state mirrors Input's destructive border. Size matches Button: xs = 24px, sm = 28px, default = 32px. Pass size when it shares a row with other controls; leave it default in labeled Field stacks.

min={0} max={100} step={5}
invalid
size ladder (xs / sm / default)

Size ladder

Input matches NumberField and Button: xs = 24px, sm = 28px, default = 32px. Use sm on mixed-height action rows so the text field doesn't sit taller than the steppers beside it.

xs / sm / default

Labeled field

The house label + control stack. Use LabeledField for ordinary inputs; HexColorField when the value is a hex color with a native swatch. Optional hint sits to the right of the label (character counts, meters); optional help sits immediately after it (a popover trigger).

LabeledField
with hint
12/60
HexColorField

Inline-editable value

Click the value to edit it in place. Enter or blur commits the change; Escape reverts to the last committed value.

Every control keeps a visible label — placeholder text is never the only label. Errors state what is wrong and how to fix it, not just that the field is "invalid".

Selectors

Choice controls — from a single toggle to a searchable multi-select. Prefer the smallest control that fits the option count: switch for one boolean, toggle group for 2-5 mutually exclusive options, select or combobox beyond that. Select and Combobox items use the shared selection blink before the popup closes.

Select

Single, with placeholder and a disabled option

Combobox

Combobox adds filtering on top of Select. Multi-select renders chosen values as removable chips and anchors its popup to the chip row.

Checkbox, radio, switch, toggle

Checkbox
Radio group
Switch & toggle

Segmented control

ToggleGroup drives mutually-exclusive choices with all options visible. Preset rows reuse plain outline xs buttons instead — they seed a control's value rather than represent a persistent selection state.

Unit
Presets

Tabs

Rendered output appears here once the tool runs.

Switch is for a single independent boolean; radio group and toggle group are for one choice among several. Never use a switch inside a group where only one item may be active at a time.

Range Controls

Sliders communicate a value within a bounded range. Pair every slider that needs precision with a NumberField sharing the same state — dragging and typing stay in sync.

Single value

Value: 30

Range (two thumbs)

Range: 20 – 70

Stepped, with min/max labels

Value: 40
0100

Slider paired with number input

The canonical pattern: slider and NumberField share one piece of state, plus a reset action that only appears once the value drifts from its default.

Every slider here is controlled — moving the thumb, typing in the paired NumberField, or clicking reset all update the same state, so the two controls never disagree.

Color Controls

Full pickers for authored colors, native inputs when a picker is overkill, and read-only swatches for inspecting theme tokens.

Color picker

A full HSVA/alpha picker with a swatch preset row and a segmented per-channel value input. Controlled — value and onChange are both required. The format selector is a separate control (one per context) so a single choice drives every picker on the page.

Value:#6366f1

Native fallback

Prefer native when a full picker is overkill — a single accent color, a favorite color, a quick tag.

#14b8a6

Theme palette

The chart token scale, read live from computed style. Each copy button resolves the value at click time rather than hard-coding it.

--chart-1
--chart-2
--chart-3
--chart-4
--chart-5

Comparison

Two swatches over a shared preview chip — the pattern for contrast-checker-type tools that compare a foreground and background pick.

#4f46e5
#f59e0b

Channel value input

Segmented, per-channel color entry (OTP-style). A channel commits on Enter, blur, or arrow-step — Shift+arrow takes the big step — and every format below stays in sync through one canonical hex.

#6366f1ff
hex
rgb
hsl
oklch

Typing edits only the local segment — nothing re-derives per keystroke, so cross-format round-trip drift cannot happen. Invalid text reverts to the derived value on commit.

Checkerboard

Transparent-color preview backdrop. checkerboardStyle(size) returns the conic-gradient CSS object; Checkerboard is the same as a div.

size={12}

Palette components

Reusable building blocks for palette-shaped tools: a row of discrete swatches, a contiguous scale strip, and a two-color WCAG contrast comparison.

Swatch row — click a swatch to select and copy its value
#f97316
#22c55e
#3b82f6
#a855f7
#ef4444
Color scale — hover a step for its label and value, click to copy
indigo
Comparison — passing pair
Paper on Ink#f9fafb
Ink on Paper#111827
16.98:1Passes AA (4.5:1)
Comparison — failing pair
Light amber on Amber#fde68a
Amber on Light amber#f59e0b
1.72:1Fails AA (4.5:1)

Colors that come from the theme are always read from computed style, never inlined as literal hex — swatch presets passed to a picker are the one exception, since they are authored choices rather than theme tokens.

File Controls

One drop zone component covers single- and multi-file intake — drag, click-to-browse, paste, per-file remove, and rejection messaging are all built in.

Single file

Images only, 2 MB max. Drop a file over 2 MB or of the wrong type to see the rejection state.

Click to upload, drag and drop, or paste
image/* · Max 2.0 MB

Multiple files

Any file type, no size limit — drag several at once, paste from the clipboard, or click to browse.

Click to upload, drag and drop, or paste

Toolbar button

variant="button" is a compact click-to-browse control for Sample/Upload/Clear rows and pane-header actions — no dashed overlay. Icon-only sizes need an aria-label.

Image stage

ImageDropZone composes FileDropZone for the image-specific case — once a file is accepted it shows a checkerboarded preview with dimensions, size, and Replace/Remove actions instead of a plain file row.

Click to upload, drag and drop, or paste
image/png, image/jpeg, image/webp, image/gif, image/avif, image/bmp · Max 5.0 MB

Export helpers

src/lib/export.ts wraps canvas and SVG export in small, dependency-free helpers — download a PNG from a canvas, or an SVG element as its own file.

Files never leave your browser. Every upload zone in this app processes files locally — nothing is sent to a server.

Generator tools end with export; these helpers are the standard path.

Structured Editors

Editors for key-value data — add, remove, and reorder rows, with inline validation for common mistakes like duplicate keys.

Key-value editor

Seeded with a duplicate 'Content-Type' key to show the built-in duplicate-key warning. Use the arrows to reorder, or the trailing button to remove a row.

Duplicate key
Duplicate key
Serialized output
[
  {
    "key": "Content-Type",
    "value": "application/json"
  },
  {
    "key": "Authorization",
    "value": "Bearer <token>"
  },
  {
    "key": "Content-Type",
    "value": "text/plain"
  }
]

Structured editors always show their serialized result — the editor is a means to an end, and the underlying data it produces should never be a mystery.