shadcn.io is an independent project built on shadcn/ui
Display Name and the field share one row. The label keeps a fixed width. The placeholder is John D.
It fits a settings row where labels should line up. A name with no row spacing is a Label. Base UI on React does not move this label above the field.
Installation
Anatomy

Usage
<Field className="max-w-md" orientation="horizontal">
<FieldLabel className="w-32" htmlFor="profile-display-name">
Display Name
</FieldLabel>
<Input id="profile-display-name" placeholder="John D." type="text" />
</Field>FAQ
How do the label and input share a row?
orientation is horizontal on Field, so Display Name and the input sit side by side. Field sets data-orientation to horizontal.
Why does the label have a fixed width?
w-32 on FieldLabel holds the label at a fixed width, so the input starts at the same inset. The field itself is capped with max-w-md.
How does Display Name connect to the input?
FieldLabel names the input. Its htmlFor matches the control's id. The label text is Display Name.
What does the input accept?
type is text. The placeholder is John D., and it clears once someone types.
API Reference
Field
Sets orientation="horizontal" and htmlFor="profile-display-name". The rest is on the Field page.
Input
Sets id="profile-display-name", placeholder="John D." and type="text". The rest is on the Input page.





