export const title = "Select components"
export const description = "Free and open-source React select components built for modern applications and websites. These select components are built using React Aria and styled with Tailwind CSS."
export const links = {
github: "https://github.com/untitleduico/react/tree/main/components/base/select",
rac: "https://react-spectrum.adobe.com/react-aria/Select.html"
}
import * as Demos from "@/components/base/select/select.demo.tsx";
## Installation
You can add this select component using our CLI or manually:
```bash
npx untitledui@latest add select
```
Copy the files below into your project:
Great! Now you can start using the select components in your project by just copy/pasting our examples below.
## Select examples
Below are examples and variations of this select component:
### Default {{ tocOnly:true }}
### Disabled {{ tocOnly:true }}
### Sizes {{ tocOnly:true }}
### Icon leading {{ tocOnly:true }}
### Avatar leading {{ tocOnly:true }}
### Dot leading {{ tocOnly:true }}
### Search {{ tocOnly:true }}
### Tags {{ tocOnly:true }}
## API reference
` as the `icon`, as the Dot leading example does. The selected option's icon or avatar also appears in the trigger, and the `icon` prop on `Select` sets a fallback icon for the trigger.",
},
{
question: "Can I select multiple options?",
answer: "Not with `Select`, which is single-selection only. For selections shown as removable tags, use `TagSelect` from `tag-select.tsx` as in the Tags example: it takes a `selectedItems` list created with `useListData` from `react-stately`. For a dropdown with checkboxes, use the [multi-select](/react/components/multi-select) component.",
},
{
question: "How do I add a label, hint, or tooltip?",
answer: "Pass `label`, `hint`, and `tooltip` to `Select`. The `tooltip` adds a help icon next to the label. Setting `isRequired` adds an asterisk to the label, which `hideRequiredIndicator` removes, and `isInvalid` switches the hint text to the error style.",
},
]}
/>