ZaidanHomeDocsComponentsBlocksChartsTypesetCreate

Command Palette

Search for a command to run...

GitHub
New
Sections
  • Introduction
  • Components
  • Blocks
  • Installation
  • Customization
  • Dark Mode
  • Typeset
  • Zaidan Skills
  • FAQ
  • Roadmap
  • Changelog
Installation
  • Astro
  • Manual
  • Solid Start
  • TanStack Router
  • TanStack Start
  • Vite
Blocks
  • Data Grid
  • Event Calendar
  • Filters
  • Gantt
  • Image Crop
  • Kanban
  • Message Scroller
  • Questionnaire
  • Sortable
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Aspect Ratio
  • Attachment
  • Avatar
  • Badge
  • Breadcrumb
  • Bubble
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Collapsible
  • Combobox
  • Command
  • Context Menu
  • Dialog
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kbd
  • Label
  • Marker
  • Menubar
  • Message
  • Native Select
  • Navigation Menu
  • Pagination
  • Popover
  • Progress
  • Radio Group
  • Resizable
  • Scroll Area
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Spinner
  • Switch
  • Table
  • Tabs
  • Textarea
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip

Field

Combine labels, controls, and help text to compose accessible form fields and grouped inputs.

Kobalte
Kobalte

Field is a Solid composition helper that uses Kobalte Label for accessible control labeling. Use the Field family to arrange labels, controls, descriptions, validation messages, and related controls.

Payment Method

All transactions are secure and encrypted

Enter your 16-digit card number

Billing Address

The billing address associated with your payment method

1
import { Button } from "~/components/ui/button";
2
import { Checkbox } from "~/components/ui/checkbox";
3
import {
4
Field,
5
FieldDescription,
6
FieldGroup,
7
FieldLabel,
8
FieldLegend,
9
FieldSeparator,
10
FieldSet,
11
} from "~/components/ui/field";
12
import { Input } from "~/components/ui/input";
13
import {
14
Select,
15
SelectContent,
16
SelectItem,
17
SelectTrigger,
18
SelectValue,
19
} from "~/components/ui/select";
20
import { Textarea } from "~/components/ui/textarea";
21
22
const months = [
23
{ label: "01", value: "01" },
24
{ label: "02", value: "02" },
25
{ label: "03", value: "03" },
26
{ label: "04", value: "04" },
27
{ label: "05", value: "05" },
28
{ label: "06", value: "06" },
29
{ label: "07", value: "07" },
30
{ label: "08", value: "08" },
31
{ label: "09", value: "09" },
32
{ label: "10", value: "10" },
33
{ label: "11", value: "11" },
34
{ label: "12", value: "12" },
35
];
36
37
const years = [
38
{ label: "2024", value: "2024" },
39
{ label: "2025", value: "2025" },
40
{ label: "2026", value: "2026" },
41
{ label: "2027", value: "2027" },
42
{ label: "2028", value: "2028" },
43
{ label: "2029", value: "2029" },
44
];
45
46
export default function FieldDemo() {
47
return (
48
<div class="w-full max-w-md">
49
<form>
50
<FieldGroup>
51
<FieldSet>
52
<FieldLegend>Payment Method</FieldLegend>
53
<FieldDescription>All transactions are secure and encrypted</FieldDescription>
54
<FieldGroup>
55
<Field>
56
<FieldLabel for="checkout-card-name">Name on Card</FieldLabel>
57
<Input id="checkout-card-name" placeholder="Evil Rabbit" required />
58
</Field>
59
<Field>
60
<FieldLabel for="checkout-card-number">Card Number</FieldLabel>
61
<Input id="checkout-card-number" placeholder="1234 5678 9012 3456" required />
62
<FieldDescription>Enter your 16-digit card number</FieldDescription>
63
</Field>
64
<div class="grid grid-cols-3 gap-4">
65
<Field>
66
<FieldLabel for="checkout-exp-month">Month</FieldLabel>
67
<Select
68
options={months}
69
optionValue="value"
70
optionTextValue="label"
71
placeholder="MM"
72
itemComponent={(props) => (
73
<SelectItem item={props.item}>{props.item.rawValue.label}</SelectItem>
74
)}
75
>
76
<SelectTrigger id="checkout-exp-month">
77
<SelectValue<(typeof months)[number]>>
78
{(state) => state.selectedOption().label}
79
</SelectValue>
80
</SelectTrigger>
81
<SelectContent />
82
</Select>
83
</Field>
84
<Field>
85
<FieldLabel for="checkout-exp-year">Year</FieldLabel>
86
<Select
87
options={years}
88
optionValue="value"
89
optionTextValue="label"
90
placeholder="YYYY"
91
itemComponent={(props) => (
92
<SelectItem item={props.item}>{props.item.rawValue.label}</SelectItem>
93
)}
94
>
95
<SelectTrigger id="checkout-exp-year">
96
<SelectValue<(typeof years)[number]>>
97
{(state) => state.selectedOption().label}
98
</SelectValue>
99
</SelectTrigger>
100
<SelectContent />
101
</Select>
102
</Field>
103
<Field>
104
<FieldLabel for="checkout-cvv">CVV</FieldLabel>
105
<Input id="checkout-cvv" placeholder="123" required />
106
</Field>
107
</div>
108
</FieldGroup>
109
</FieldSet>
110
<FieldSeparator />
111
<FieldSet>
112
<FieldLegend>Billing Address</FieldLegend>
113
<FieldDescription>
114
The billing address associated with your payment method
115
</FieldDescription>
116
<FieldGroup>
117
<Field orientation="horizontal">
118
<Checkbox id="checkout-same-as-shipping" defaultChecked />
119
<FieldLabel for="checkout-same-as-shipping" class="font-normal">
120
Same as shipping address
121
</FieldLabel>
122
</Field>
123
</FieldGroup>
124
</FieldSet>
125
<FieldSet>
126
<FieldGroup>
127
<Field>
128
<FieldLabel for="checkout-comments">Comments</FieldLabel>
129
<Textarea
130
id="checkout-comments"
131
placeholder="Add any additional comments"
132
class="resize-none"
133
/>
134
</Field>
135
</FieldGroup>
136
</FieldSet>
137
<Field orientation="horizontal">
138
<Button type="submit">Submit</Button>
139
<Button variant="outline" type="button">
140
Cancel
141
</Button>
142
</Field>
143
</FieldGroup>
144
</form>
145
</div>
146
);
147
}

Installation

pnpm dlx shadcn@latest add @zaidan/field
npx shadcn@latest add @zaidan/field
yarn dlx shadcn@latest add @zaidan/field
bunx --bun shadcn@latest add @zaidan/field

Usage

1
import {
2
Field,
3
FieldContent,
4
FieldDescription,
5
FieldError,
6
FieldGroup,
7
FieldLabel,
8
FieldLegend,
9
FieldSeparator,
10
FieldSet,
11
FieldTitle,
12
} from "~/components/ui/field";
1
<FieldSet>
2
<FieldLegend>Profile</FieldLegend>
3
<FieldDescription>This appears on invoices and emails.</FieldDescription>
4
<FieldGroup>
5
<Field>
6
<FieldLabel for="name">Full name</FieldLabel>
7
<Input id="name" autocomplete="off" placeholder="Evil Rabbit" />
8
<FieldDescription>This appears on invoices and emails.</FieldDescription>
9
</Field>
10
<Field>
11
<FieldLabel for="username">Username</FieldLabel>
12
<Input id="username" autocomplete="off" aria-invalid />
13
<FieldError>Choose another username.</FieldError>
14
</Field>
15
<Field orientation="horizontal">
16
<Switch id="newsletter" />
17
<FieldLabel for="newsletter">Subscribe to the newsletter</FieldLabel>
18
</Field>
19
</FieldGroup>
20
</FieldSet>

Composition

Field

A single control with label, helper text, and validation.

Field
├── FieldLabel
├── Input / Textarea / Switch / Select
├── FieldDescription
└── FieldError

FieldGroup

Related fields in one group. Use FieldSeparator between sections when needed.

FieldGroup
├── Field
│ ├── FieldLabel
│ ├── Input / Textarea / Switch / Select
│ ├── FieldDescription
│ └── FieldError
├── FieldSeparator
└── Field
├── FieldLabel
└── Input / Textarea / Switch / Select

FieldSet

Semantic grouping with a legend and description, usually containing a FieldGroup.

FieldSet
├── FieldLegend
├── FieldDescription
└── FieldGroup
├── Field
│ ├── FieldLabel
│ ├── Input / Textarea / Switch / Select
│ ├── FieldDescription
│ └── FieldError
└── Field
├── FieldLabel
└── Input / Textarea / Switch / Select

Anatomy

The Field family is designed for composing accessible forms. A typical field is structured as follows:

1
<Field>
2
<FieldLabel for="input-id">Label</FieldLabel>
3
{/* Input, Select, Switch, etc. */}
4
<FieldDescription>Optional helper text.</FieldDescription>
5
<FieldError>Validation message.</FieldError>
6
</Field>
  • Field is the core wrapper for a single field.
  • FieldContent is a flex column that groups label and description. It is not required without a description.
  • Wrap related fields with FieldGroup, and use FieldSet with FieldLegend for semantic grouping.

Input

Choose a unique username for your account.

Must be at least 8 characters long.

1
import {
2
Field,
3
FieldDescription,
4
FieldGroup,
5
FieldLabel,
6
FieldSet,
7
} from "~/components/ui/field";
8
import { Input } from "~/components/ui/input";
9
10
export default function FieldInput() {
11
return (
12
<FieldSet class="w-full max-w-xs">
13
<FieldGroup>
14
<Field>
15
<FieldLabel for="field-username">Username</FieldLabel>
16
<Input id="field-username" type="text" placeholder="Max Leiter" />
17
<FieldDescription>Choose a unique username for your account.</FieldDescription>
18
</Field>
19
<Field>
20
<FieldLabel for="field-password">Password</FieldLabel>
21
<FieldDescription>Must be at least 8 characters long.</FieldDescription>
22
<Input id="field-password" type="password" placeholder="••••••••" />
23
</Field>
24
</FieldGroup>
25
</FieldSet>
26
);
27
}

Textarea

Share your thoughts about our service.

1
import {
2
Field,
3
FieldDescription,
4
FieldGroup,
5
FieldLabel,
6
FieldSet,
7
} from "~/components/ui/field";
8
import { Textarea } from "~/components/ui/textarea";
9
10
export default function FieldTextarea() {
11
return (
12
<FieldSet class="w-full max-w-xs">
13
<FieldGroup>
14
<Field>
15
<FieldLabel for="field-feedback">Feedback</FieldLabel>
16
<Textarea id="field-feedback" placeholder="Your feedback helps us improve..." rows={4} />
17
<FieldDescription>Share your thoughts about our service.</FieldDescription>
18
</Field>
19
</FieldGroup>
20
</FieldSet>
21
);
22
}

Select

Select your department or area of work.

1
import { Field, FieldDescription, FieldLabel } from "~/components/ui/field";
2
import {
3
Select,
4
SelectContent,
5
SelectItem,
6
SelectTrigger,
7
SelectValue,
8
} from "~/components/ui/select";
9
10
const items = [
11
{ label: "Engineering", value: "engineering" },
12
{ label: "Design", value: "design" },
13
{ label: "Marketing", value: "marketing" },
14
{ label: "Sales", value: "sales" },
15
{ label: "Customer Support", value: "support" },
16
{ label: "Human Resources", value: "hr" },
17
{ label: "Finance", value: "finance" },
18
{ label: "Operations", value: "operations" },
19
];
20
21
export default function FieldSelect() {
22
return (
23
<Field class="w-full max-w-xs">
24
<FieldLabel for="field-department">Department</FieldLabel>
25
<Select
26
options={items}
27
optionValue="value"
28
optionTextValue="label"
29
placeholder="Choose department"
30
itemComponent={(props) => (
31
<SelectItem item={props.item}>{props.item.rawValue.label}</SelectItem>
32
)}
33
>
34
<SelectTrigger id="field-department">
35
<SelectValue<(typeof items)[number]>>
36
{(state) => state.selectedOption().label}
37
</SelectValue>
38
</SelectTrigger>
39
<SelectContent />
40
</Select>
41
<FieldDescription>Select your department or area of work.</FieldDescription>
42
</Field>
43
);
44
}

Slider

Price Range

Set your budget range ($200 - 800).

1
import { createSignal } from "solid-js";
2
3
import { Field, FieldDescription, FieldTitle } from "~/components/ui/field";
4
import { Slider } from "~/components/ui/slider";
5
6
export default function FieldSlider() {
7
const [value, setValue] = createSignal([200, 800]);
8
9
return (
10
<Field class="w-full max-w-xs">
11
<FieldTitle>Price Range</FieldTitle>
12
<FieldDescription>
13
Set your budget range ($<span class="font-medium tabular-nums">{value()[0]}</span> -{" "}
14
<span class="font-medium tabular-nums">{value()[1]}</span>).
15
</FieldDescription>
16
<Slider
17
value={value()}
18
onChange={(nextValue) => setValue(nextValue)}
19
maxValue={1000}
20
minValue={0}
21
step={10}
22
class="mt-2 w-full"
23
aria-label="Price Range"
24
/>
25
</Field>
26
);
27
}

Fieldset

Address Information

We need your address to deliver your order.

1
import {
2
Field,
3
FieldDescription,
4
FieldGroup,
5
FieldLabel,
6
FieldLegend,
7
FieldSet,
8
} from "~/components/ui/field";
9
import { Input } from "~/components/ui/input";
10
11
export default function FieldFieldset() {
12
return (
13
<FieldSet class="w-full max-w-sm">
14
<FieldLegend>Address Information</FieldLegend>
15
<FieldDescription>We need your address to deliver your order.</FieldDescription>
16
<FieldGroup>
17
<Field>
18
<FieldLabel for="field-street">Street Address</FieldLabel>
19
<Input id="field-street" type="text" placeholder="123 Main St" />
20
</Field>
21
<div class="grid grid-cols-2 gap-4">
22
<Field>
23
<FieldLabel for="field-city">City</FieldLabel>
24
<Input id="field-city" type="text" placeholder="New York" />
25
</Field>
26
<Field>
27
<FieldLabel for="field-postal-code">Postal Code</FieldLabel>
28
<Input id="field-postal-code" type="text" placeholder="90502" />
29
</Field>
30
</div>
31
</FieldGroup>
32
</FieldSet>
33
);
34
}

Checkbox

Show these items on the desktop

Select the items you want to show on the desktop.

Your Desktop & Documents folders are being synced with iCloud Drive. You can access them from other devices.

1
import { Checkbox } from "~/components/ui/checkbox";
2
import {
3
Field,
4
FieldContent,
5
FieldDescription,
6
FieldGroup,
7
FieldLabel,
8
FieldLegend,
9
FieldSeparator,
10
FieldSet,
11
} from "~/components/ui/field";
12
13
export default function FieldCheckbox() {
14
return (
15
<FieldGroup class="w-full max-w-xs">
16
<FieldSet>
17
<FieldLegend variant="label">Show these items on the desktop</FieldLegend>
18
<FieldDescription>Select the items you want to show on the desktop.</FieldDescription>
19
<FieldGroup class="gap-3">
20
<Field orientation="horizontal">
21
<Checkbox id="field-hard-disks" defaultChecked />
22
<FieldLabel for="field-hard-disks" class="font-normal">
23
Hard disks
24
</FieldLabel>
25
</Field>
26
<Field orientation="horizontal">
27
<Checkbox id="field-external-disks" />
28
<FieldLabel for="field-external-disks" class="font-normal">
29
External disks
30
</FieldLabel>
31
</Field>
32
<Field orientation="horizontal">
33
<Checkbox id="field-cds-dvds" />
34
<FieldLabel for="field-cds-dvds" class="font-normal">
35
CDs, DVDs, and iPods
36
</FieldLabel>
37
</Field>
38
<Field orientation="horizontal">
39
<Checkbox id="field-connected-servers" />
40
<FieldLabel for="field-connected-servers" class="font-normal">
41
Connected servers
42
</FieldLabel>
43
</Field>
44
</FieldGroup>
45
</FieldSet>
46
<FieldSeparator />
47
<Field orientation="horizontal">
48
<Checkbox id="field-sync-folders" defaultChecked />
49
<FieldContent>
50
<FieldLabel for="field-sync-folders">Sync Desktop & Documents folders</FieldLabel>
51
<FieldDescription>
52
Your Desktop & Documents folders are being synced with iCloud Drive. You can access them
53
from other devices.
54
</FieldDescription>
55
</FieldContent>
56
</Field>
57
</FieldGroup>
58
);
59
}

Radio

Subscription Plan

Yearly and lifetime plans offer significant savings.

1
import {
2
Field,
3
FieldDescription,
4
FieldLabel,
5
FieldLegend,
6
FieldSet,
7
} from "~/components/ui/field";
8
import { RadioGroup, RadioGroupItem } from "~/components/ui/radio-group";
9
10
export default function FieldRadio() {
11
return (
12
<FieldSet class="w-full max-w-xs">
13
<FieldLegend variant="label">Subscription Plan</FieldLegend>
14
<FieldDescription>Yearly and lifetime plans offer significant savings.</FieldDescription>
15
<RadioGroup defaultValue="monthly">
16
<Field orientation="horizontal">
17
<RadioGroupItem value="monthly" id="field-plan-monthly" />
18
<FieldLabel for="field-plan-monthly" class="font-normal">
19
Monthly ($9.99/month)
20
</FieldLabel>
21
</Field>
22
<Field orientation="horizontal">
23
<RadioGroupItem value="yearly" id="field-plan-yearly" />
24
<FieldLabel for="field-plan-yearly" class="font-normal">
25
Yearly ($99.99/year)
26
</FieldLabel>
27
</Field>
28
<Field orientation="horizontal">
29
<RadioGroupItem value="lifetime" id="field-plan-lifetime" />
30
<FieldLabel for="field-plan-lifetime" class="font-normal">
31
Lifetime ($299.99)
32
</FieldLabel>
33
</Field>
34
</RadioGroup>
35
</FieldSet>
36
);
37
}

Switch

1
import { Field, FieldLabel } from "~/components/ui/field";
2
import { Switch } from "~/components/ui/switch";
3
4
export default function FieldSwitch() {
5
return (
6
<Field orientation="horizontal" class="w-fit">
7
<FieldLabel for="field-two-factor">Multi-factor authentication</FieldLabel>
8
<Switch id="field-two-factor" />
9
</Field>
10
);
11
}

Choice Card

Wrap Field components inside FieldLabel to create selectable field groups. This works with RadioGroupItem, Checkbox, and Switch components.

Compute Environment

Select the compute environment for your cluster.

1
import {
2
Field,
3
FieldContent,
4
FieldDescription,
5
FieldGroup,
6
FieldLabel,
7
FieldLegend,
8
FieldSet,
9
FieldTitle,
10
} from "~/components/ui/field";
11
import { RadioGroup, RadioGroupItem } from "~/components/ui/radio-group";
12
13
export default function FieldChoiceCard() {
14
return (
15
<FieldGroup class="w-full max-w-xs">
16
<FieldSet>
17
<FieldLegend variant="label">Compute Environment</FieldLegend>
18
<FieldDescription>Select the compute environment for your cluster.</FieldDescription>
19
<RadioGroup defaultValue="kubernetes">
20
<FieldLabel for="field-kubernetes">
21
<Field orientation="horizontal">
22
<FieldContent>
23
<FieldTitle>Kubernetes</FieldTitle>
24
<FieldDescription>Run GPU workloads on a K8s cluster.</FieldDescription>
25
</FieldContent>
26
<RadioGroupItem value="kubernetes" id="field-kubernetes" />
27
</Field>
28
</FieldLabel>
29
<FieldLabel for="field-virtual-machine">
30
<Field orientation="horizontal">
31
<FieldContent>
32
<FieldTitle>Virtual Machine</FieldTitle>
33
<FieldDescription>Access a cluster to run GPU workloads.</FieldDescription>
34
</FieldContent>
35
<RadioGroupItem value="vm" id="field-virtual-machine" />
36
</Field>
37
</FieldLabel>
38
</RadioGroup>
39
</FieldSet>
40
</FieldGroup>
41
);
42
}

Field Group

Stack Field components with FieldGroup. Add FieldSeparator to divide them.

Get notified when ChatGPT responds to requests that take time, like research or image generation.

Get notified when tasks you've created have updates. Manage tasks

1
import { Checkbox } from "~/components/ui/checkbox";
2
import {
3
Field,
4
FieldDescription,
5
FieldGroup,
6
FieldLabel,
7
FieldSeparator,
8
FieldSet,
9
} from "~/components/ui/field";
10
11
export default function FieldGroupDemo() {
12
return (
13
<FieldGroup class="w-full max-w-xs">
14
<FieldSet>
15
<FieldLabel>Responses</FieldLabel>
16
<FieldDescription>
17
Get notified when ChatGPT responds to requests that take time, like research or image
18
generation.
19
</FieldDescription>
20
<FieldGroup data-slot="checkbox-group">
21
<Field orientation="horizontal">
22
<Checkbox id="field-push-notifications" defaultChecked disabled />
23
<FieldLabel for="field-push-notifications" class="font-normal">
24
Push notifications
25
</FieldLabel>
26
</Field>
27
</FieldGroup>
28
</FieldSet>
29
<FieldSeparator />
30
<FieldSet>
31
<FieldLabel>Tasks</FieldLabel>
32
<FieldDescription>
33
Get notified when tasks you&apos;ve created have updates.{" "}
34
<a href="#field-group">Manage tasks</a>
35
</FieldDescription>
36
<FieldGroup data-slot="checkbox-group">
37
<Field orientation="horizontal">
38
<Checkbox id="field-task-push-notifications" />
39
<FieldLabel for="field-task-push-notifications" class="font-normal">
40
Push notifications
41
</FieldLabel>
42
</Field>
43
<Field orientation="horizontal">
44
<Checkbox id="field-task-email-notifications" />
45
<FieldLabel for="field-task-email-notifications" class="font-normal">
46
Email notifications
47
</FieldLabel>
48
</Field>
49
</FieldGroup>
50
</FieldSet>
51
</FieldGroup>
52
);
53
}

Responsive Layout

  • Vertical fields: The default orientation stacks label, control, and helper text for mobile-first layouts.
  • Horizontal fields: Set orientation="horizontal" on Field to align the label and control side-by-side. Pair with FieldContent to keep descriptions aligned.
  • Responsive fields: Set orientation="responsive" for automatic column layouts inside container-aware parents. FieldGroup provides the @container/field-group container used by the component styles.
Profile

Fill in your profile information.

Provide your full name for identification

1
import { Button } from "~/components/ui/button";
2
import {
3
Field,
4
FieldContent,
5
FieldDescription,
6
FieldGroup,
7
FieldLabel,
8
FieldLegend,
9
FieldSet,
10
} from "~/components/ui/field";
11
import { Input } from "~/components/ui/input";
12
13
export default function FieldResponsive() {
14
return (
15
<div class="w-full max-w-lg">
16
<form>
17
<FieldSet>
18
<FieldLegend>Profile</FieldLegend>
19
<FieldDescription>Fill in your profile information.</FieldDescription>
20
<FieldGroup>
21
<Field orientation="responsive">
22
<FieldContent>
23
<FieldLabel for="field-responsive-name">Name</FieldLabel>
24
<FieldDescription>Provide your full name for identification</FieldDescription>
25
</FieldContent>
26
<Input id="field-responsive-name" placeholder="Evil Rabbit" required />
27
</Field>
28
<Field orientation="responsive">
29
<Button type="submit">Submit</Button>
30
<Button type="button" variant="outline">
31
Cancel
32
</Button>
33
</Field>
34
</FieldGroup>
35
</FieldSet>
36
</form>
37
</div>
38
);
39
}

Validation and Errors

  • Add data-invalid to Field to switch the entire block into an error state.
  • Add aria-invalid on the input itself for assistive technologies.
  • Render FieldError immediately after the control or inside FieldContent to keep error messages aligned with the field.
1
<Field data-invalid>
2
<FieldLabel for="email">Email</FieldLabel>
3
<Input id="email" type="email" aria-invalid />
4
<FieldError>Enter a valid email address.</FieldError>
5
</Field>

Accessibility

  • FieldSet and FieldLegend keep related controls grouped for keyboard and assistive-tech users.
  • Field outputs role="group" so nested controls inherit labeling from FieldLabel and FieldLegend when combined.
  • Apply FieldSeparator sparingly so screen readers encounter clear section boundaries.

API Reference

For primitive label props and keyboard behavior, see the Kobalte Label API reference.

FieldSet

Container that renders a semantic fieldset with spacing presets.

PropTypeDefault
classstring-
<FieldSet>
<FieldLegend>Delivery</FieldLegend>
<FieldGroup>{/* Fields */}</FieldGroup>
</FieldSet>

FieldLegend

Legend element for a FieldSet. Switch to the label variant to align with label sizing.

PropTypeDefault
variant"legend" | "label""legend"
classstring-
<FieldLegend variant="label">Notification Preferences</FieldLegend>

The FieldLegend has two variants: legend and label. The label variant applies label sizing and alignment. Handy if you have a nested FieldSet.

FieldGroup

Layout wrapper that stacks Field components and enables container queries for responsive orientations.

PropTypeDefault
classstring-
<FieldGroup class="@container/field-group flex flex-col gap-6">
<Field>{/* ... */}</Field>
<Field>{/* ... */}</Field>
</FieldGroup>

Field

The core wrapper for a single field. Provides orientation control, invalid state styling, and spacing.

PropTypeDefault
orientation"vertical" | "horizontal" | "responsive""vertical"
data-invalidboolean-
classstring-
<Field orientation="horizontal">
<FieldLabel for="remember">Remember me</FieldLabel>
<Switch id="remember" />
</Field>

FieldContent

Flex column that groups control and descriptions when the label sits beside the control. Not required if you have no description.

PropTypeDefault
classstring-
<Field>
<Checkbox id="notifications" />
<FieldContent>
<FieldLabel for="notifications">Notifications</FieldLabel>
<FieldDescription>Email, SMS, and push options.</FieldDescription>
</FieldContent>
</Field>

FieldLabel

Label styled for both direct inputs and nested Field children.

PropTypeDefault
classstring-
<FieldLabel for="email">Email</FieldLabel>

FieldTitle

Renders a title with label styling inside FieldContent.

PropTypeDefault
classstring-
<FieldContent>
<FieldTitle>Enable Touch ID</FieldTitle>
<FieldDescription>Unlock your device faster.</FieldDescription>
</FieldContent>

FieldDescription

Helper text slot that automatically balances long lines in horizontal layouts.

PropTypeDefault
classstring-
<FieldDescription>We never share your email with anyone.</FieldDescription>

FieldSeparator

Visual divider to separate sections inside a FieldGroup. Accepts optional inline content.

PropTypeDefault
classstring-
<FieldSeparator>Or continue with</FieldSeparator>

FieldError

Accessible error container that accepts children or an errors array (e.g., from a form library).

PropTypeDefault
errorsArray<{ message?: string } | undefined>-
classstring-
<FieldError errors={errors.username} />

When the errors array contains multiple messages, the component renders a list automatically.

On This Page

  • Installation
  • Usage
  • Composition
    • Field
    • FieldGroup
    • FieldSet
  • Anatomy
  • Input
  • Textarea
  • Select
  • Slider
  • Fieldset
  • Checkbox
  • Radio
  • Switch
  • Choice Card
  • Field Group
  • Responsive Layout
  • Validation and Errors
  • Accessibility
  • API Reference
    • FieldSet
    • FieldLegend
    • FieldGroup
    • Field
    • FieldContent
    • FieldLabel
    • FieldTitle
    • FieldDescription
    • FieldSeparator
    • FieldError
Built by Kevin Abatan. The source code is available on GitHub.