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.
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.
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.
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).
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
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
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.
Tabs
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
Range (two thumbs)
Stepped, with min/max labels
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.
Native fallback
Prefer native when a full picker is overkill — a single accent color, a favorite color, a quick tag.
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.
Comparison
Two swatches over a shared preview chip — the pattern for contrast-checker-type tools that compare a foreground and background pick.
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.
#6366f1ffTyping 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.
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.
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.
Multiple files
Any file type, no size limit — drag several at once, paste from the clipboard, or click to browse.
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.
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.
[
{
"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.