Corpora UI
Atoms

Field

Form field wrapper wiring label, control, description and error together.

Use the story controls to explore the Field atom's properties.

Props

The Field atom wraps input controls with label, description and error states:

Basic structure

  • FieldLabel: Accessible label for the form field
  • Input: The actual input control
  • FieldDescription: Optional description text
  • FieldError: Error message display

Input

The input example includes size, type, state, and styled or unstyled variant controls.

Label

Labels stay paired with their input so the accessible relationship is visible in context.

Usage

This UI module is also available from @exegia/corpora-ui/ui/field.

import { Field, FieldLabel, FieldDescription, Input } from "@exegia/corpora-ui"

<Field>
  <FieldLabel>Email</FieldLabel>
  <Input type="email" />
  <FieldDescription>We will never share your email.</FieldDescription>
</Field>

API reference

ComponentPropTypeDefaultDescription
FielddisabledbooleanfalseDisables the grouped field controls.
FieldinvalidbooleanfalseExposes the invalid state to field children.
Inputsize"sm" | "default" | "lg" | number"default"Controls the input height and padding.
InputunstyledbooleanfalseRemoves the styled wrapper for custom compositions.
LabelsoundbooleanfalseOpts into the label hover cue.

Last updated on

On this page