nessra uinessra ui

Displays a list of options for the user to pick from.

Loading...
import {
  Select,
  SelectContent,

Installation

pnpmnpmyarnbun
pnpm dlx shadcn@latest add https://nessra-ui.vercel.app/r/select.json

Usage

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select"
<Select>
  <SelectTrigger className="w-[180px]">
    <SelectValue placeholder="Select a fruit" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="apple">Apple</SelectItem>
    <SelectItem value="banana">Banana</SelectItem>
    <SelectItem value="orange">Orange</SelectItem>
  </SelectContent>
</Select>

Examples

With Groups

Loading...
import {
  Select,
  SelectContent,

API Reference

Select

ComponentDescription
SelectThe root component
SelectTriggerThe trigger button
SelectValueThe selected value display
SelectContentThe dropdown content
SelectItemIndividual select option
SelectGroupGroup of items
SelectLabelLabel for a group
SelectSeparatorVisual separator

Select Props

PropTypeDefaultDescription
valuestring-The controlled value
defaultValuestring-The default value
onValueChange(value: string) => void-Callback when value changes
disabledbooleanfalseDisable the select

SelectItem Props

PropTypeDefaultDescription
valuestring-The value of the item (required)
disabledbooleanfalseDisable the item