GitHub

Field

Form field wrapper with label, input, and error message

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { Field } from "@corew500/ui/field"

<Field>Content</Field>

Variants

fieldVariants

AxisValuesDefault
orientation
verticalhorizontalresponsive
vertical

CMS Integration

CMSPayload CMS Integration
This component supports CMS-driven content via @corew500/cms-payload.
Loading...

API Reference

Props

PropTypeDefaultDescription
orientationenumvertical

Accessibility

Screen Readers

  • - `Field` uses `role="group"` for proper grouping semantics
  • `FieldError` uses `role="alert"` for screen reader announcements

Additional

  • `FieldSet` uses native `<fieldset>` element for form grouping
  • `FieldLegend` uses native `<legend>` for fieldset labeling
  • Labels are properly associated with inputs via `htmlFor`
  • Disabled state indicated via `data-disabled` and reduced opacity

Localization

Translatable Content

  • - All text content (labels, descriptions, errors) are passed as children
  • Components accept pre-resolved translated strings
  • Error messages should be pre-translated before passing to `FieldError`

Related

External Resources