Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-field-error

Field error

Free

The error line under a form control whose value was refused, saying what to fix, inside the control's Field, for React and Tailwind CSS. Free, MIT.

Type an email without an @ and leave the field: the error arrives under it. Type a username and leave it: it is checked for a moment, and a taken one (fieldwork, admin, teodora) is refused. Change the words and the error goes. Look switches stacked fields, settings rows, rows with a description, rows with a region (open its list and close it with nothing chosen), or errors that run on to more lines. The username check is a timer over three names of our own.

When to use

  • The error line under a form control whose value was refused, saying what to fix, inside the control's Field.
  • Also called: validation message or error text.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Field error on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

Terminal
npx shadcn@4.23.1 add @goop/trail-field-error
PROMPT
Add the Goop Field error to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { FieldError, FieldInvalid } from '@/components/ui/goop/field-error';
import { Field } from '@/components/ui/goop/field';
import { TextInput } from '@/components/ui/goop/text-input';

<Field label="Work email">
  <FieldInvalid error="Enter an address with an @ in it.">
    <TextInput type="email" defaultValue="mira.example.com" />
  </FieldInvalid>
</Field>
  • Fits: account, flow (their recipes).
  • width, gap, text: add no class for these.

API reference

  • Types: FieldInvalidControlProps = { id?: string; 'aria-describedby'?: string; disabled?: boolean; 'aria-invalid'?: boolean | 'true' | 'false' }
Parts
PartWhat it is
FieldInvalidA control and, when its value is refused, the error line under it; error?: ReactNode — What is wrong and how to put it right; nothing, false or '' shows no error; errorId?: string — The error line's id; a generated one when left out; id?: string — The control's id, handed on to it (never the group's); aria-describedby?: string — What else describes the control, handed on to it before the error's id; disabled?: boolean — Disables the control (never the group) and dims the error line with it; children: ReactElement<FieldInvalidControlProps> | ((control: FieldInvalidControlProps) => ReactNode) — The control, or a function that spreads the wiring on a nested control
  • data-slot values (to select a part by): field-error, field-error-group, field-error-icon, field-error-text

Accessibility

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
disabledthe attribute data-disabled

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/trail/components/field-error.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-field-error

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.