Search components
Find a component by name
Field
Accessible form field layout: FieldSet, FieldLegend, FieldGroup, Field, FieldLabel, FieldDescription, FieldError.
Field wraps one control with its FieldLabel, FieldDescription and FieldError. FieldGroup stacks fields, and FieldSet with FieldLegend groups related ones semantically. For forms wired to React Hook Form, see the Form page.
Input
Put FieldDescription before or after the Input; its spacing adjusts either way. Point FieldLabel's htmlFor at the input's id.
Textarea
A Textarea takes the same label and helper text as an input.
Select
Give the SelectTrigger the id that FieldLabel points at. Inside a vertical Field, the trigger stretches to full width.
Slider
Use FieldTitle when there is no single element to label, and give the Slider an aria-label. The description can show the live value.
Fieldset
FieldSet renders a semantic fieldset, and FieldLegend names the whole group for assistive tech. Put fields in a grid inside FieldGroup to place them side by side.
Checkbox
Use orientation="horizontal" to put a Checkbox beside its label, and FieldLegend variant="label" for a legend at label size. Wrap the label and description in FieldContent so they stay aligned next to the control.
Radio
Give each RadioGroupItem its own horizontal Field inside the RadioGroup, with the group titled by FieldLegend.
Switch
A horizontal Field with the label first puts the Switch at the end of the row.
Choice Card
Wrap a Field in FieldLabel to make the whole card selectable. This works with RadioGroupItem, Checkbox and Switch. The boxed choice cards the apps already use are RadioGroupItemBoxed and CheckboxBoxed.
Field Group
FieldGroup stacks Fields and FieldSeparator divides them. Add data-slot="checkbox-group" to a group of checkboxes for tighter spacing.
Responsive Layout
orientation="responsive" stacks label and control in narrow containers and puts them side by side once the parent FieldGroup (a @container/field-group) is wide enough. Use orientation="horizontal" to keep them side by side always.
Installation
npx shadcn@latest add @refer/fieldVariations
Ported from shadcn's examples. Open Code on any section to see and copy it.
Choose a unique username for your account.
We'll never share your email with anyone.
This field must be filled out.
This field is currently disabled.
This field contains validation errors.
This field is currently disabled.
Maximum 500 characters allowed.
Tell us about yourself in a few sentences.
Enter your message so it is long enough to test the layout.
This field contains validation errors.
This field is currently disabled.
Select the country where you currently reside.
Choose your local timezone for accurate scheduling.
This field contains validation errors.
This field is currently disabled.
Receive weekly updates about new features and promotions.
Enable Touch ID to quickly unlock your device.
Turn on airplane mode to disable all connections.
Receive emails about new products, features, and more.
Manage your privacy preferences.
This switch has validation errors.
This switch is currently disabled.
Current brightness: 75%
Higher quality uses more bandwidth.
Range: 0.3 - 0.7
$25 - $75
Red: 10%, Green: 20%, Blue: 70%
This slider has validation errors.
This slider is currently disabled.
Select the country where you currently reside.
Choose your local timezone for accurate scheduling.
Native select with grouped options using optgroup.
This field contains validation errors.
This field is currently disabled.
Enter the 6-digit code sent to your email.
Enter the code from your authenticator app.
Enter your 4-digit PIN (numbers only).
This OTP field contains validation errors.
This OTP field is currently disabled.
Enter your preferred username.
Write a short description about yourself.
Receive email updates about your account.
Choose your favorite fruit.
Select your country.
Adjust the volume level.
Usage in the apps
Which apps install this component, whether their copy matches the registry, and which files import it.
No app imports this component. From olympus-backend@2ee40d05e, Oct 26, 2026. โIn syncโ means the app's copy matches this registry; refresh with npm run usage:build.