For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
0
Sponsor

Select

Displays a list of options for the user to pick from—triggered by a button.

import {
  Select,
  SelectContent,
  SelectGroup,
  SelectItem,
  SelectLabel,

Installation

$ pnpm dlx shadcn@latest add https://shadcn-cssinjs.vercel.app/r/select.json

Usage

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select/select";
<Select>
  <SelectTrigger>
    <SelectValue placeholder="Theme" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="light">Light</SelectItem>
    <SelectItem value="dark">Dark</SelectItem>
  </SelectContent>
</Select>

Composition

Use the following composition to build a Select:

Select
├── SelectTrigger
│   └── SelectValue
└── SelectContent
    └── SelectGroup
        ├── SelectLabel
        ├── SelectItem
        └── SelectSeparator

RTL

To enable right-to-left support, see the RTL guide.

"use client";

import { useTranslation } from "@/components/language-selector";
import type { Translations } from "@/components/language-selector";
import {
  Select,

API Reference

See the Base UI documentation for the full API.