Pickers

Select

A customizable dropdown menu that lets users choose a single option from a predefined list, optimized for accessibility and usability.

Basic

A select component displays a dropdown list of options, allowing users to pick one from the list.

Loading...

Installation

npx shadcn@latest add @intentui/select

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

This component comes packed with several components to enhance functionality and provide a seamless experience.

Manual installation

npm i react-aria-components @intentui/icons

Anatomy

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
} from "@/components/ui/select"
const software = [
  { id: 1, name: "Adobe Photoshop" },
  { id: 2, name: "Sketch" },
  { id: 3, name: "Figma" },
  { id: 4, name: "Adobe XD" },
  { id: 5, name: "InVision" },
]

<Select aria-label="Design software" placeholder="Select a software">
  <SelectTrigger />
  <SelectContent items={software}>
    {(item) => (
      <SelectItem id={item.id} textValue={item.name}>
        {item.name}
      </SelectItem>
    )}
  </SelectContent>
</Select>

Section

A select component can display items grouped together in sections.

Loading...

Searchable select

Sometimes, you may need to search for an item in a select component. Here's how you can do it.

Loading...

With icon

Loading...

With avatar

Loading...

Validation

If a user submits the form without selecting an item, an error message will appear.

Loading...

Controlled

You can control the select component by passing the selectedKey prop.

Loading...

Uncontrolled

You can uncontrolled the select component by passing the defaultSelectedKey prop.

Loading...

Label

When the children option is a string, Select.Label will automatically wrap it. However, if the option includes an icon or avatar, you'll need to manually define the wrapper like this:

<Select.Item id="discord" textValue="Discord">
  <IconBrandDiscord />
  <Select.Label>Discord</Select.Label>
</Select.Item>

Details description

If you need to provide more information about an option, use the Select.Description component to display additional details.

Loading...

Disabled

When the select component is disabled, it cannot be interacted with.

Loading...
Unlock the full power of
Design Intent UI
Build modern web apps faster with 350+ blocks and polished templates crafted for professionals.
Explore