Skip to content
nexubDesign System
v12.7.0

Components · Form & Input

Form Field

StableAdded v0.0.1

Wraps Label, Input, HelperText and FormError into a single accessible group.

import { FormField } from '@nexub/react';
View as Markdown

Examples

Default

Enter your legal name.

Agent states

`streaming` while an agent types into the field, then `generated` with accept and clear. The person can edit at any time; editing drops the "Suggested" mark. Strings come from `suggested`, `acceptSuggestion` and `clearSuggestion` in messages.

Shown to the customer.

Props

Props
PropTypeDefaultDescription
namestring—Name attribute forwarded to the underlying input.
idstring—Explicit id for the input; defaults to the name value.
requiredboolean—Marks the field as required and renders a required indicator on the label.
streamingboolean—An agent is filling the field (12.4): aria-busy and a calm shimmer on the control. Pass the value as text arrives; the control stays editable.
generatedboolean—The value came from an agent (12.4): a "Suggested" mark beside the label, read as part of the control's description. Editing the value clears it; turning generated off and on shows it again.
onAcceptSuggestion(() => void)—With generated: an accept button beside the mark. Clears the mark and keeps the value.
onClearSuggestion(() => void)—With generated: a clear button beside the mark. Clear the value here; the mark goes too.
disabledboolean—
invalidboolean—