Skip to content
nexubDesign System
v11.9.0

Components · Form & Input

Form Error

StableAdded v0.0.1

An error message with an alert icon, announced when it appears.

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

Usage

Use it for
  • A validation message under a field you lay out yourself

Use something else for
  • Inside `FormField.Root`: use `FormField.Error`, which wires the ids for you

  • Errors for a whole form: use the Error Summary pattern

Playground

Props

TSX
<FormError id="fe-email-error">Enter an email address like name@example.com.</FormError>

Examples

Under a field

Props

Props
PropTypeDefaultDescription
childrenReactNode—The message: say what went wrong and how to fix it.
idstring—Point the control at it with aria-describedby so the message is read with the field.

Accessibility

ARIA roles

alert

Screen reader

  • Has `role="alert"`, so it is announced when rendered. Render it only when there is an error.

On iOS & Android