Skip to Content
DocsEnterpriseBlogShowcase

Field

Used to add labels, help text, and error messages to form fields.

SourceStorybookRecipe

Setup

If you don't already have the snippet, run the following command to add the field snippet

chakra snippet add field

The snippet includes a closed component composition for the Field component.

Usage

import { Field } from "@/components/ui/field"
<Field>
  <Input />
</Field>

Examples

Error Text

Use the invalid and errorText to indicate that the field is invalid.

This is an error text

Helper Text

Use the helperText prop to add helper text to the field.

This is a helper text

Disabled

Use the disabled prop to disable the field.

Textarea

Here's how to use the field component with a textarea.

Native Select

Here's how to use the field component with a native select.