Field
Form Structure

Field

Form row: label + control + hint/error. The standard wrapper for every input in settings panes and wizards.

Props

FieldProps props
PropTypeDefaultDescription
labelReactNode—Label above the control.
hintReactNode—Dim helper line under the control. Replaced by error when both are set.
errorReactNode—Error message shown under the control. Triggers the invalid state on nested inputs.
requiredboolean—Appends a red asterisk to the label.
labelMetaReactNode—Right-aligned meta next to the label (e.g. remaining chars, 'optional').
htmlForstring—Associates the label with a form control id.
childrenReactNode—The form control rendered inside the field.

Field extends HTMLAttributes<HTMLDivElement>.

Usage

Basic

Field

With hint

Email address for account notifications.
Field with hint

With error

Please enter a valid email address.
Field with error

Required indicator

Required field

With labelMeta

42 / 200
Field with labelMeta
ImportTSX
import { Field } from "@solarius/onset";
import type { FieldProps } from "@solarius/onset";

<Field label="Username" required>
  <Input placeholder="Enter your username" />
</Field>
<Field label="Email" hint="Email address for account notifications.">
  <Input placeholder="you@example.com" />
</Field>
<Field label="Password" error="Must be at least 8 characters.">
  <Input placeholder="••••••••" />
</Field>