# Native select: Invalid

> Set `aria-invalid` and link the message with `aria-describedby`.

Example: https://hextaui.com/docs/native-select/examples/invalid
Component docs: https://hextaui.com/docs/native-select.md

## Add this example

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

This adds `components/examples/native-select/invalid.tsx` with the Native select component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/native-select/invalid.tsx"
import { NativeSelect, NativeSelectOption } from "@/components/ui/native-select"

export function NativeSelectInvalid() {
  return (
    <div className="flex w-full max-w-sm flex-col gap-2">
      <NativeSelect
        aria-label="Country"
        aria-invalid
        aria-describedby="native-select-invalid-message"
        className="w-full"
      >
        <NativeSelectOption value="">Select a country</NativeSelectOption>
        <NativeSelectOption value="in">India</NativeSelectOption>
        <NativeSelectOption value="de">Germany</NativeSelectOption>
      </NativeSelect>
      <p
        id="native-select-invalid-message"
        className="text-sm text-destructive"
      >
        We don&apos;t ship to the selected region yet.
      </p>
    </div>
  )
}
```

## Props in this example

### NativeSelect

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` | – | Applied to the wrapper, so it sizes the whole control. |

## More Native select examples

- [Groups](https://hextaui.com/docs/native-select/examples/groups.md)
- [Sizes](https://hextaui.com/docs/native-select/examples/sizes.md)
- [Field](https://hextaui.com/docs/native-select/examples/field.md)
- [Disabled](https://hextaui.com/docs/native-select/examples/disabled.md)
- [Controlled](https://hextaui.com/docs/native-select/examples/controlled.md)
- [Long content](https://hextaui.com/docs/native-select/examples/long-content.md)
- [Right to left](https://hextaui.com/docs/native-select/examples/rtl.md)
