← 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.

Prompt generating…
send saved128 / 500

shape=straight · inner=flush · radius=8px · inner cells fill the full height (square-in-square / circle-in-circle, no gap)

shape
inner fit
size
radius8px

anatomy — the parts, named

Every field is composed from the same parts. Learn these once, build any field. Two separate layers: a construction halo (one line per field edge) and annotations dotted right on each part's border — hover a label to highlight its part.

layer
top box
medium
bottom box
slim
leading outerinput rowtop boxtrailing outer
deck.pdf4.1 MBshot.png860 KB

Guests can view · link expires in 7 days

inner flushfieldbottom boxinner inset
Root
<UniversalInput shape size innerFit radius>
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 / Bottom
<Top> <Bottom>
Expansion boxes inside the border. Grow the field vertically.
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 / Below
<Above> <Below>
Annotation rows docked to the field column. Aligned with or without outers.
Fit
flush / inset / padded
How an Inner sits: full-bleed cell, bare content, or filled chip with radius = field − padding.
Spot
above/below × leading/center/trailing
The six named positions around a field.
<UniversalInput shape="straight" size="md" innerFit="flush">
  <UniversalInput.Outer label="filters" onClick={…}>
    <SlidersHorizontal />
  </UniversalInput.Outer>
  <UniversalInput.Field>
    <UniversalInput.Inner position="leading">
      <Search />
    </UniversalInput.Inner>
    <UniversalInput.Input placeholder="Search…" />
    <UniversalInput.Inner position="trailing" fit="inset" onClick={…}>
      <Mic />
    </UniversalInput.Inner>
  </UniversalInput.Field>
  <UniversalInput.Outer label="send" onClick={…}>
    <Send />
  </UniversalInput.Outer>
</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.

top box
bottom box
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
•••