Skip to content

Field

Category: Forms & inputs

<Field>
<Field.Label htmlFor="email" required>
Email
</Field.Label>
<input id="email" type="email" />
<Field.Description>We'll never share it.</Field.Description>
<Field.Error>Please enter a valid email.</Field.Error>
</Field>
  • Field.Label — <label>. required prop adds a red asterisk.
  • Field.Description — <p> styled as helper text.
  • Field.Error — <p> with role="alert". Use only when the field is invalid.

Install: @helix-ui/core

import { Field } from '@helix-ui/core';

status: stable · since: 0.1.0

Tags: label, description, error, wrapper

Label (required)
[control]
Help text describing the field
Error message
  • display — block
  • width — fill
  • height — content
  • intrinsicSize — vertical stack, hugs control height
  • stackable — true
  • fullBleed — false

A vertical stack: a label (font.weight.semibold), the wrapped control, an optional muted description, and an error message in danger tone when present.

Name Type Default Description
...rest HTMLAttributes<HTMLDivElement> — Native div attributes.
  • children — Field.Label, the control, Field.Description, Field.Error in any order

color.text.primary, color.text.secondary, color.text.action.danger, font.family.sans, font.size.sm, font.weight.medium, space.2

Notes

  • Field.Label defaults to a context-generated control ID. TextInput, Textarea, Select, MultiSelect, NumberField, and Autocomplete adopt it when they have no own label or explicit ID. Wire htmlFor/id yourself for native/custom controls or explicit IDs.
  • Field.Error has role="alert" so screen readers announce changes.
Component Relation Note
TextInput wraps Wrap any non-RAC control with Field for label/description/error.
Form parent Inside a Form.
Textarea sibling
Checkbox sibling
Switch sibling
RadioGroup sibling

These are the AI prompt → JSX mappings used by the helix-ui prompt DSL and integrations like Cursor / Claude Code.

“add label/help to a custom select”

<Field>
<Field.Label htmlFor="country">Country</Field.Label>
<CustomSelect id="country" />
<Field.Description>Used for tax purposes</Field.Description>
</Field>