Y2K UI

Select

A flat dropdown select. Trigger shows the current value, content panel is a bordered white list with a lemon highlight on the focused item.

select-demo.app

Installation

terminal.sh
npx y2kui@latest add select

Usage

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select";

Props

Select

PropTypeDefaultDescription
valuestringControlled selected value.
defaultValuestringInitial selected value (uncontrolled).
onValueChange(value: string) => voidFired when the value changes.
disabledbooleanfalseDisable the select.

SelectTrigger

PropTypeDefaultDescription
classNamestringAdditional Tailwind classes (e.g. width).
childrenReactNodeMust include a `SelectValue`.

On this page