shadcn.io is an independent project built on shadcn/ui
Project Name is stacked, placeholder My Project, with This will be visible to all team members under it. Make project public sits beside a switch, with Anyone on the internet can see this project. Archive this project when complete is a checkbox.
Reach for it when one form mixes a text field with row settings. If the archive line is the only choice, a Checkbox is enough. On React, Base UI does not publish the project.
Installation
Anatomy

Usage
<FieldGroup className="max-w-md">
<Field>
<FieldLabel htmlFor="project-name">Project Name</FieldLabel>
<Input id="project-name" placeholder="My Project" type="text" />
<FieldDescription>
This will be visible to all team members.
</FieldDescription>
</Field>
<Field orientation="horizontal">
<FieldContent>
<FieldLabel htmlFor="project-public">Make project public</FieldLabel>
<FieldDescription>
Anyone on the internet can see this project.
</FieldDescription>
</FieldContent>
<Switch id="project-public" />
</Field>
<Field orientation="horizontal">
<Checkbox id="project-archive" />
<FieldLabel className="font-normal" htmlFor="project-archive">
Archive this project when complete
</FieldLabel>
</Field>
</FieldGroup>FAQ
Why is Project Name stacked when the other rows are not?
That Field leaves orientation unset, so it stays vertical: FieldLabel, Input, then FieldDescription. The description reads This will be visible to all team members.
How does the public switch line up with its hint?
That Field sets orientation to horizontal. FieldContent holds the FieldLabel Make project public and the FieldDescription, and the Switch is the other child.
How is the archive checkbox labeled?
The Checkbox comes first, then a FieldLabel with font-normal. The label reads Archive this project when complete. orientation is horizontal.
How do the labels connect to their controls?
FieldLabel names that control. Its htmlFor matches the control's id. Project Name's input is type text, with placeholder My Project.
API Reference
Field
Sets htmlFor="project-name", orientation="horizontal", htmlFor="project-public" and htmlFor="project-archive". The rest is on the Field page.
Input
Sets id="project-name", placeholder="My Project" and type="text". The rest is on the Input page.
Switch
Sets id="project-public". The rest is on the Switch page.
Checkbox
Sets id="project-archive". The rest is on the Checkbox page.





