Field

A composable form field pattern for labels, controls, descriptions, and errors.

Preview#

Use your work email.

Controls
import { Field, FieldDescription, FieldLabel, Input } from "raft-ui";

<Field>
  <FieldLabel />
  <Input />
  <FieldDescription />
</Field>

Structure#

Field owns the form copy structure. Keep the control itself narrow: use Input, Textarea, or another control inside it.

Visible to everyone in this server.

Compact label#

Shown to other workspace members.

States#

Use your work email.

This field is locked.

Controls#

Use FieldItem for choice controls where the label and helper copy should sit beside the control instead of above it.

Visible in the project switcher.

/
0/160

Markdown is supported.

Managed by workspace settings.

Send an update when this changes.

API#WIP

PropTypeDefaultDescription
...propsBase UI Field.RootStacks label, control, helper text, and error. Pass invalid for externally controlled errors.
PropTypeDefaultDescription
...propsBase UI Field.LabelPersistent field label. Supports required, optional, and size for dense labels.
PropTypeDefaultDescription
...propsBase UI Field.DescriptionHelper text below the control. It participates in aria-describedby.
PropTypeDefaultDescription
...propsBase UI Field.ErrorInline validation message. Use match for Base UI validity states, or match={true} for external state.
PropTypeDefaultDescription
...propsBase UI Field.ItemHorizontal grouping for checkbox, radio, or switch rows inside a field.
PropTypeDefaultDescription
...propsBase UI Field.ControlOptional native control primitive when you do not need Input or Textarea.
PropTypeDefaultDescription
...propsBase UI Field.ValidityRender-prop access to the current Base UI field validity state.