Components
Field
Fields group form controls with labels, descriptions, and validation messages to provide clear context and accessibility.
Stable
GitHubEnter your full name.
Anatomy
Anatomy
import {Field, TextField} from '@staffbase/design';
<Field.Root>
<Field.Label />
<Field.Description />
{/* Form control goes here */}
<Field.Error />
</Field.Root>Examples
Required label
Invalid state
Password must be at least 8 characters.
API reference
Root
Inherits props fromBase UI Field Root
| Name | Type | Description |
|---|---|---|
children | ReactNode | The field content, usually a label, control, optional description, and optional error. |
Label
Inherits props fromBase UI Field Label
| Name | Type | Description |
|---|---|---|
children | ReactNode | The visible label text for the associated control. |
requiredLabel | string | Optional text rendered in parentheses after the label to indicate required input. |
Description
Inherits props fromBase UI Field Description
| Name | Type | Description |
|---|---|---|
children | ReactNode | Supplementary helper text that is announced with the associated control. |
Error
Inherits props fromBase UI Field Error
| Name | Type | Description |
|---|---|---|
children | ReactNode | The error message content. |
When to use
When not to use
How to use
Structure
Enter your name as it appears on your passport.
Labels
Do
Short Title Case labels with no trailing punctuation.
Don't
Instructional labels, trailing colons, and the label repeated as placeholder.
Descriptions & placeholders
Do
Placeholder shows an example value the label doesn't cover.
Don't
User Email
Placeholder and description just repeat the label.
Validation & errors
Enter an email address in the format name@company.com.