# Error Message

> Alias for FieldError — same component, different export name.

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

## Install

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

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

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

## Import

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

```tsx
import { ErrorMessage } from "@/components/ui/error-message"
```

## Usage

```tsx
import { ErrorMessage } from "@/components/ui/error-message"

export function Example() {
  return <ErrorMessage>Something went wrong.</ErrorMessage>
}
```

## API

### ErrorMessage

Re-exports `FieldError`.

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

## Notes

- Installing `error-message` also pulls `field-error`.

## See also

- [HTML page](https://ui.anuragroy.dev/component/error-message): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/error-message.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.
