form-field — wyrd.component.form-field

FormField

Form control wrapper that provides reusable label, description, required, invalid, and error association semantics.

Install @wyrd-company/react or the Flutter package and use it directly — your DESIGN.md does the styling.

01

Examples

Generated from the contract's examples block. Previews are the published @wyrd-company/react component, themed by the brand's role tokens — flip the site's light/dark toggle and they follow.

Code target Applies to every example on component pages.
empty state: default
Text input

Use the name shown to collaborators.

Usage
import { WyrdFormField } from "@wyrd-company/react";

<WyrdFormField label="Name" description="Use the name shown to collaborators.">
  Text input
</WyrdFormField>
required state: required
Text input

We need this to greet you.

Usage
import { WyrdFormField } from "@wyrd-company/react";

<WyrdFormField isRequired label="Name" description="We need this to greet you.">
  Text input
</WyrdFormField>
invalid state: invalid
Text input
Usage
import { WyrdFormField } from "@wyrd-company/react";

<WyrdFormField isInvalid isRequired label="Name" error="Name is required.">
  Text input
</WyrdFormField>
02

Properties

NameTypeDefaultSummary
is-required boolean false Marks the wrapped control as required.
is-invalid boolean false Marks the wrapped control as invalid and associates the error slot.
03

Slots & events

SlotCardinalityAcceptsSummary
label exactly-one text, node Visible label and accessible-name source for the wrapped control.
control exactly-one component, node Wrapped input, select, or other form control.
description zero-or-one text, node Hint or help text associated with the wrapped control.
error zero-or-one text, node Validation message associated when is-invalid is true.
04

Tokens

The contract's token bindings. Open the shared contextual sidebar from any example; primary swatches reflect the color you pick there. Error swatches show the active preset's values; editing any knob switches to custom and resets error to TWW · Ink.

BindingToken
root.gap spacing.xs
label.color color.on-surface
label.text typography.label-md
required-indicator.color color.error
description.color color.on-surface-variant
description.text typography.body-md
error.color color.error
error.text typography.body-md
05

States

StateSourceSummary
default platform Field with label and control.
required property Required state derived from is-required.
invalid property Invalid state derived from is-invalid.
06

Accessibility

From the contract's accessibility obligations. Role group; Label slot provides the accessible name for the wrapped control.

  • Keyboard behavior is owned by the wrapped control.
  • Required and invalid states are exposed on the wrapped control when the target platform allows it.
  • Error text is associated only when invalid.
  • Verified under: rtl, reduced-motion, cvd-deuteranopia, density-compact, text-expansion.
07

SDUI

Status: serializable. Form Field serializes wrapper semantics only; wrapped controls retain their own value and event contracts.

SerializableMembers
Propertiesis-required, is-invalid
Slotslabel, control, description, error
Events
The Wyrding Way — a contract-first design system. © Wyrd Company