Docs
选择

选择

显示用户可从中选择的选项列表 - 由按钮触发。

安装

¥Installation

pnpm dlx shadcn@latest add select

用法

¥Usage

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select"
<Select>
  <SelectTrigger className="w-[180px]">
    <SelectValue placeholder="Theme" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="light">Light</SelectItem>
    <SelectItem value="dark">Dark</SelectItem>
    <SelectItem value="system">System</SelectItem>
  </SelectContent>
</Select>

示例

¥Examples

可滚动

¥Scrollable

表单

¥Form

You can manage email addresses in your email settings.