docs/components/field
Sections
Components
Utilities
Forms
Hooks
Copy Markdown
Container for inputs, labels, and helper text.
PreviewCode
Username
Choose a unique username for your account.
CLIManual
pnpmbunnpmyarn
pnpm dlx shadcn@latest add @shark/field
FieldSet
├── FieldLegend
└── FieldGroup
├── Field
├── FieldLabel
│ └── FieldRequiredIndicator
├── FieldTitle
├── FieldDescription
├── FieldSeparator
├── FieldHelper
└── FieldError
import {
Field,
FieldLabel,
FieldInput,
FieldHelper,
FieldError
} from "@/components/ui/field";
<Field>
<FieldLabel>Email</FieldLabel>
<FieldInput />
<FieldHelper>Enter your email address</FieldHelper>
<FieldError>Email is required</FieldError>
</Field>
PreviewCode
Subscribe
PreviewCode
Fruits
Select an item.
PreviewCode
Fruits
Select an item.
PreviewCode
Fruits
Select multiple items.
PreviewCode
Bio
Write a short bio. Maximum 500 characters.
PreviewCode
Country
Select a country
BrazilMexicoIreland
Used for shipping estimates
PreviewCode
Receive notifications
You'll receive a notification when someone posts a comment
PreviewCode
Select the items you want to show:
Hard disks
External disks
CDs, DVDs, and iPods
Connected servers
PreviewCode
Choose Plan
Free
Pro
Enterprise
Select the plan that fits your needs.
PreviewCode
Airplane mode
Use SliderLabel inside the Slider to label the slider.
PreviewCode
Volume
Adjust the volume of the media player
PreviewCode
Quantity
PreviewCode
Newsletter
Choose how you want to receive updates about new features and product releases.
Weekly digest
Updates
Get notified about important account activity. View activity log
Security alerts
Billing reminders
Root layout for label, control, and helper/error text.
| Prop | Type | Default |
|---|---|---|
orientation | `"vertical" | "horizontal" |
reverse | boolean | false |
invalid | boolean | - |
disabled | boolean | - |
required | boolean | - |
readOnly | boolean | - |
asChild | boolean | - |
className | string | - |
Groups related form controls semantically.
| Prop | Type | Default |
|---|---|---|
className | string | - |
Legend or label for a FieldSet group.
| Prop | Type | Default |
|---|---|---|
variant | `"legend" | "label"` |
className | string | - |
Groups multiple fields with consistent spacing.
| Prop | Type | Default |
|---|---|---|
className | string | - |
Wraps label, description, and error. Use with horizontal orientation.
| Prop | Type | Default |
|---|---|---|
className | string | - |
Label associated with the control.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | - |
className | string | - |
| Prop | Type | Default |
|---|---|---|
children | ReactNode | "*" |
className | string | - |
asChild | boolean | - |
Title wrapper for grouped field content.
| Prop | Type | Default |
|---|---|---|
className | string | - |
Helper text or description. Shown in muted foreground.
| Prop | Type | Default |
|---|---|---|
className | string | - |
Horizontal divider between field groups. Optional center label.
| Prop | Type | Default |
|---|---|---|
children | ReactNode | - |
className | string | - |
Alias for FieldDescription. Use for consistency with other form libraries.
| Prop | Type | Default |
|---|---|---|
className | string | - |
Error message shown when the field is invalid. Shown in destructive color.
| Prop | Type | Default |
|---|---|---|
className | string | - |
For a complete list of props, see the Ark UI documentation.
[
Previous page
Editable ](/docs/components/editable)[
Next page
File Upload ](/docs/components/file-upload)
On This Page
InstallationAnatomyUsageExamplesInputAutocompleteComboboxCombobox MultipleTextareaSelectCheckboxCheckbox GroupRadio GroupSwitchSliderNumber InputField GroupAPI ReferenceFieldFieldSetFieldLegendFieldGroupFieldContentFieldLabelFieldRequiredIndicatorFieldTitleFieldDescriptionFieldSeparatorFieldHelperFieldError