lab

universal input

One field, two shapes, inner slots that go flush (full-bleed 1:1) or inset (bare content + gap) — plus detached outer slots. Every circle is polymorphic: button, text, icon, menu, popover, or tooltip-only.

playground

anatomy — the parts, named

Every field is composed from the same parts. Learn these once, build any field. Two separate layers: a construction grid marking every edge, and click-any-part popups carrying each part's number, title, and explanation.

Label
straight · md · flush
deck.pdf4.1 MBshot.png860 KB

Guests can view · link expires in 7 days

Click any part for details
8 parts annotated
Root
<UniversalInput shape size innerFit radius invalid error>
Horizontal layout: outer slots + field. Owns the tokens.
Field
<Field>
The bordered container. Single row, or expanded with boxes.
Row
<Row> · auto
Fixed-height input row. Added for you if you skip it.
Inner
<Inner position fit width>
Slot inside the border. flush = full-bleed, inset = bare, padded = filled chip (radius = field − padding); width auto hugs text.
Outer
<Outer fit width>
Detached slot outside the border. Fixed width; full field height on single-row fields, row height AND row-docked when expanded; fit forces square/circle, width auto hugs text.
Top
<Top>
Expansion box above the row. Any content, any height.
Bottom
<Bottom>
Expansion box below the row. Toolbars, captions, notices.
Input
<Input>
The native text field. Takes any input props.
Annotation
<Annotation>
Floating label in a Spot. plain text, pill ring, or sketch marker.
Above
<Above>
Annotation row docked to the field column. Aligned with or without outers.
Below
<Below>
Annotation row under the field column. Same docking as Above.
Specimen
<Specimen top bottom>
Docs overlay: measured construction grid + click-any-part popups.
Label
<Label>
Large field-label text for Above/Below rows. First child takes the leading corner, second the trailing.

Tip: click a row — or a line below — to locate the part in the specimen.

<UniversalInput shape="straight" size="md" innerFit="flush">
<UniversalInput.Above>
<UniversalInput.Label>Label</UniversalInput.Label>
<UniversalInput.Annotation>straight · md · flush</UniversalInput.Annotation>
</UniversalInput.Above>
<UniversalInput.Outer label="filters" onClick={…}>
<SlidersHorizontal />
</UniversalInput.Outer>
<UniversalInput.Field>
<UniversalInput.Top className="flex gap-1.5 p-2">
<span>deck.pdf</span>
<span>shot.png</span>
</UniversalInput.Top>
<UniversalInput.Inner position="leading">
<Search />
</UniversalInput.Inner>
<UniversalInput.Input placeholder="Search…" />
<UniversalInput.Inner position="trailing" onClick={…}>
<Send />
</UniversalInput.Inner>
<UniversalInput.Bottom className="flex justify-between px-3 py-1.5">
<span>2 files attached</span>
</UniversalInput.Bottom>
</UniversalInput.Field>
<UniversalInput.Outer label="voice" onClick={…}>
<Globe />
</UniversalInput.Outer>
<UniversalInput.Below>
<UniversalInput.Label>8 parts annotated</UniversalInput.Label>
</UniversalInput.Below>
</UniversalInput>

boxes — any height, any content

Top and Bottom boxes live inside the field border and expand its height. Switch each one — the field grows and shrinks around whatever you put in: a tall map, a file strip, a slim notice, a toolbar, a caption, or nothing at all.

Central Park
N
not located yet · z14
slim · auto heightnotice use case

Guests can view · link expires in 7 days

medium · auto heightattachments + caption use cases
deck.pdf4.1 MBshot.png860 KB
2 files attached5.0 MB
tall · fixed h-36 + scrollresults use case
esc
4 commands↑↓ to navigate

presets

$
i
https://
site.com/@
⌘
□
□
⏎
Label hint text
○
○
0 / 200esc clearoptional
↵
en.wikipedia.org — real iframe, not a mock
•••