# Field Error

> Validation error text for a field.

Registry name: `field-error`. HTML docs: https://ui.anuragroy.dev/component/field-error.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/field-error.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/field-error.json`.

Registry JSON: https://ui.anuragroy.dev/r/field-error.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/field-error.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

```tsx
import { FieldError } from "@/components/ui/field-error"
```

## Usage

```tsx
import { FieldError } from "@/components/ui/field-error"

export function Example() {
  return <FieldError>This field is required.</FieldError>
}
```

## API

### FieldError

Destructive helper text. Prefer `TextFieldError` inside a TextField.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | string | — |  |

## See also

- [HTML page](https://ui.anuragroy.dev/component/field-error): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/field-error.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
