Component

Select

A dropdown select component with Neo-Brutalism styling. Built on Radix UI Select primitive.

Preview

Installation

pnpm dlx brutx@latest add select

Usage

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

<Select>
  <SelectTrigger>
    <SelectValue placeholder="Select option" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="option1">Option 1</SelectItem>
    <SelectItem value="option2">Option 2</SelectItem>
  </SelectContent>
</Select>

Examples

Multiple Groups with Separators

Organize options into groups with labels and separators.

Controlled Select

Control the select state programmatically with value and onValueChange.

Selected: None

With Disabled Items

Use disabled prop to disable specific options.

Disabled Select

Disable the entire select component.

API Reference

Select

The root component that manages state.

PropTypeDefaultDescription
valuestring-Controlled value
onValueChange(value: string) => void-Callback when value changes
defaultValuestring-Initial value (uncontrolled)
disabledbooleanfalseDisable the select

SelectContent

The dropdown content container.

PropTypeDefaultDescription
position"popper" | "item-aligned""popper"Positioning mode for dropdown
side"top" | "bottom" | "left" | "right""bottom"Position relative to trigger

SelectItem

Individual option item.

PropTypeDefaultDescription
valuestringrequiredUnique value for the option
disabledbooleanfalseDisable this option

All Exports

ComponentDescription
SelectRoot component
SelectTriggerButton that opens dropdown
SelectValueDisplays selected value
SelectContentDropdown container
SelectItemIndividual option
SelectGroupGroup options together
SelectLabelLabel for a group
SelectSeparatorVisual divider between groups
SelectScrollUpButtonScroll up indicator for long lists
SelectScrollDownButtonScroll down indicator for long lists

Accessibility

  • Enter / Space opens dropdown and selects item
  • navigate between options
  • Escape closes the dropdown
  • Type to search and focus matching options
  • Full screen reader support