# Shadcn Error Message

> Input with error message

- Type: example, free and open source (MIT)
- Component: [Input](https://reui.io/components/input.md)
- Page: https://reui.io/components/input/c-input-5
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/input.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/input.md
- MCP: `get_example("c-input-5")`
- Registry item: https://reui.io/r/styles/base-nova/c-input-5.json
- Uses: Field, Input

## Best for

An email field shown in its red invalid state with a single error line below

## Agent notes

- `aria-invalid` is hardcoded to true and the `FieldError` text is fixed; set both from your validation result

## When not to use

- Several failed rules listed at once, each with its own warning mark: use [Multiple Errors](https://reui.io/components/input/c-input-21.md) (`get_example("c-input-21")`)

## Install

```bash
npx shadcn@latest add @reui/c-input-5
```

## About Shadcn Input

### When to use

- Labeled text, email and search fields, plain or restyled as a pill, an underline or borderless
- Native typed fields for passwords, phones, URLs, numbers, dates, times, files, colors and ranges
- Field states and hints: disabled, required or optional marks, errors, character counts and password strength

### When not to use

- Icons, buttons, units or a prefix that sit inside the border of the box: use [Input Group](https://reui.io/components/input-group.md) (`get_component("input-group")`)
- International numbers chosen by country flag and formatted as the user types: use [Phone Input](https://reui.io/components/phone-input.md) (`get_component("phone-input")`)
- A whole create or edit page that gathers many fields under one save action: use the [Form blocks](https://reui.io/blocks/application/form.md)

### Agent notes

- The red invalid border comes from `aria-invalid` on `Input` in every style; `FieldError` only prints the message

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
