# Input: Invalid

> `aria-invalid` turns the edge and the focus ring red. Link the message with `aria-describedby` so it is announced, not just colored.

Example: https://hextaui.com/docs/input/examples/invalid
Component docs: https://hextaui.com/docs/input.md

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/input-invalid.json
```

This adds `components/examples/input/invalid.tsx` with the Input component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/input/invalid.tsx"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"

export function InputInvalid() {
  return (
    <div className="flex w-full max-w-sm flex-col gap-2">
      <Label htmlFor="input-invalid">Email</Label>
      <Input
        id="input-invalid"
        type="email"
        defaultValue="preet@"
        aria-invalid
        aria-describedby="input-invalid-error"
      />
      <p id="input-invalid-error" className="text-sm text-destructive">
        Enter a full email address, like name@example.com.
      </p>
    </div>
  )
}
```

## Props in this example

### Input

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `string \| number \| string[]` | – |  |
| `type` | `string` | `"text"` |  |
| `aria-invalid` | `boolean` | – | Shows the invalid edge and focus ring. |

## More Input examples

- [Sizes](https://hextaui.com/docs/input/examples/sizes.md)
- [With a description](https://hextaui.com/docs/input/examples/description.md)
- [Native validation](https://hextaui.com/docs/input/examples/native-validation.md)
- [Disabled](https://hextaui.com/docs/input/examples/disabled.md)
- [Read only](https://hextaui.com/docs/input/examples/read-only.md)
- [File](https://hextaui.com/docs/input/examples/file.md)
- [Input types](https://hextaui.com/docs/input/examples/types.md)
- [Controlled](https://hextaui.com/docs/input/examples/controlled.md)
- [With a button](https://hextaui.com/docs/input/examples/with-button.md)
- [Grid](https://hextaui.com/docs/input/examples/grid.md)
- [Long content](https://hextaui.com/docs/input/examples/long-content.md)
- [Right to left](https://hextaui.com/docs/input/examples/rtl.md)
