Skip to content
kapable

Field

Forms · 1 export · v0.1.0 · showcase

Label, native control, hint, required state, and server error wired as one field.

Browse 72 component families

1–60 characters.

Usage

Field usage
<Field label="App" name="app" required hint="1–60 characters." />

API

Field API

FieldProps

Field props
proptypenotes
labelstringVisible label text.
namestringForm field name (also forwarded to custom controls).
id?stringExplicit control id — set it when an ErrorSummary link needs a stable anchor ("#email"); otherwise the render owns an internal id.
error?string | nullError message; renders in `status.fail` and sets `aria-invalid` when a non-empty string.
hint?RemixNodeAssistive hint; renders in `text-muted` and joins `aria-describedby`. Takes any node — the Search composition puts a `<Kbd>` in here.
prefix?RemixNodeAdornment INSIDE the field before the input ("https://", a glyph) — mono, muted, non-interactive; default-input path only. Decorative: bake meaning into `label`/`hint`, not the adornment.
suffix?RemixNodeAdornment inside the field after the input ("ms", "@example.dev").
required?booleanMarks the control required (native `required` + a quiet visual marker).
disabled?booleanDisables the default control.
inputType?stringDefault control's input type. `'text'` by default.
placeholder?stringDefault control placeholder.
defaultValue?stringDefault control initial value (uncontrolled).
autoComplete?stringDefault control `autocomplete` token.
children?(attrs: FieldControlAttrs) => RemixNodeCustom control render prop. Receives the wiring attrs and OWNS the control; when provided, Field renders no default input.
control?(attrs: FieldControlAttrs) => RemixNodeSame contract as function-children, as a PROP — use this inside islands: a function passed as a JSX CHILD crashes the client reconciler ("Unexpected RemixNode"; Sharp Edge 13), while a function prop is plain data. Wins over children when both are set.
mix?MixInputComposition passthrough for the wrapping element.

More in Forms

More in Forms