Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

FormField

Label and feedback compositions for profile fields.

Preview

Live preview

Changes apply to this preview only.

Profile

A complete form: required fields, a helper, an error, a grouped pair and an action.

Shown on your public profile.

Social

Optional links.

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Field

The label, the control and the message are wired together: htmlFor, id, aria-describedby and aria-invalid.

Open preview

Error and optional

errorMessage replaces helperText, marks the control invalid and is announced as an alert.

Open preview

Message

FormMessage also works on its own for a short hint or an error.

Open preview

Usage

Connect the field's id to its label and descriptive feedback rather than duplicating labels.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluFormFieldProps

Type source
PimoluFormFieldProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—The control, usually wrapped in FormControl.
labelReactNode—Visible label.
idstring | undefined—Explicit id of the control; generated when omitted.
helperTextReactNode—Supporting text below the control.
errorMessageReactNode—Error text; takes precedence over helperText.
requiredboolean | undefinedfalseMarks the control and its label as required.
optionalboolean | undefinedfalseShows the optional hint after the label.
optionalLabelstring | undefined"Optional"Text of the optional hint. Defaults to "Optional".
invalidboolean | undefinedfalseInvalid state without a message.
disabledboolean | undefinedfalseDisable the field and its label.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
childrenRequired

ReactNode

No default extracted.

The control, usually wrapped in FormControl.

label

ReactNode

No default extracted.

Visible label.

id

string | undefined

No default extracted.

Explicit id of the control; generated when omitted.

helperText

ReactNode

No default extracted.

Supporting text below the control.

errorMessage

ReactNode

No default extracted.

Error text; takes precedence over helperText.

required

boolean | undefined

Default: false

Marks the control and its label as required.

optional

boolean | undefined

Default: false

Shows the optional hint after the label.

optionalLabel

string | undefined

Default: "Optional"

Text of the optional hint. Defaults to "Optional".

invalid

boolean | undefined

Default: false

Invalid state without a message.

disabled

boolean | undefined

Default: false

Disable the field and its label.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluFormControlProps

Type source
PimoluFormControlProps public API
NameTypeDefaultDescription
childrenRequiredReactElement<unknown, string | JSXElementConstructor<any>>—A single form control. It receives the generated id, aria-describedby, aria-invalid, required and disabled from the surrounding FormField.
childrenRequired

ReactElement<unknown, string | JSXElementConstructor<any>>

No default extracted.

A single form control. It receives the generated id, aria-describedby, aria-invalid, required and disabled from the surrounding FormField.

PimoluFormMessageProps

Type source
PimoluFormMessageProps public API
NameTypeDefaultDescription
childrenReactNode—Public Pimolu prop; see the source declaration for details.
variant"helper" | "error" | undefined"helper"Helper text or an error. Defaults to "helper".
idstring | undefined—Explicit id, for aria-describedby.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
children

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

variant

"helper" | "error" | undefined

Default: "helper"

Helper text or an error. Defaults to "helper".

id

string | undefined

No default extracted.

Explicit id, for aria-describedby.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluFormGroupProps

Type source
PimoluFormGroupProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
labelReactNode—Group heading.
descriptionReactNode—Supporting text under the heading.
orientation"horizontal" | "vertical" | undefined"vertical"Direction of the items. Defaults to "vertical".
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

label

ReactNode

No default extracted.

Group heading.

description

ReactNode

No default extracted.

Supporting text under the heading.

orientation

"horizontal" | "vertical" | undefined

Default: "vertical"

Direction of the items. Defaults to "vertical".

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluFieldsetProps

Type source
PimoluFieldsetProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
legendRequiredReactNode—Native legend of the fieldset.
descriptionReactNode—Supporting text under the legend.
disabledboolean | undefinedfalseDisable every control in the fieldset.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

legendRequired

ReactNode

No default extracted.

Native legend of the fieldset.

description

ReactNode

No default extracted.

Supporting text under the legend.

disabled

boolean | undefined

Default: false

Disable every control in the fieldset.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

Accessibility

  • Keep help and errors associated with the input and explain errors in text.
Read the accessibility guide →