Field

Label, control, and hint or error together.

Installation

import { Field } from "~/components/ui/Field";

Usage

We never share it.

<Field label="Email" hint="We never share it.">
  <Input type="email" />
</Field>

With error

Enter a valid email.

<Field label="Email" error="Enter a valid email.">
  <Input aria-invalid />
</Field>

API reference

PropTypeDefaultDescription
labelstring-The field label.
hintReactNode-Helper text under the control.
errorReactNode-Error message (shown instead of the hint).

Accessibility

  • Renders a label element; pass htmlFor plus a matching id on the control to associate them.
View site