Ballmac UI home

Select

A Radix select with a sized trigger, popper-positioned menu, scroll buttons, groups, labels, separators and a check indicator on the chosen item.

Installation

$ pnpm dlx shadcn@latest add @ballmac/select

Usage

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

The full example is in the Code tab above.

Examples

Grouped

API reference

<SelectTrigger>

PropTypeDefault
size

Matches Input and Button heights: sm is h-8, default is h-9.

"sm" | "default""default"

<SelectContent>

PropTypeDefault
position

"popper" opens below the trigger like a menu; "item-aligned" overlaps the trigger like a native select.

"popper" | "item-aligned""popper"
sideOffset

Distance in px from the trigger when position is "popper".

number4

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Space / Enter / ArrowDownOpens the menu
ArrowUp / ArrowDownMoves between items
EnterSelects the focused item
Type a letterJumps to the matching item
EscapeCloses the menu

Use with AI

Pick one value from a list. Compose Select > SelectTrigger > SelectValue and SelectContent > SelectItem (group with SelectGroup + SelectLabel). The menu is portalled and keyboard navigable with typeahead. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Select (@ballmac/select) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Choosing one option from 4 to 20 fixed values (timezone, role, region)
  • Compact filters in toolbars (size sm)
  • Grouped options such as regions by continent

Not for

  • Two or three options that should stay visible (use a radio group or segmented control)
  • Long searchable lists (use a combobox)
  • Actions rather than values (use a dropdown menu)

Registry JSON: https://ui.ballmac.com/r/select.json

Credits

Based on shadcn/ui Select, adapted by Ballmac. Free to use in personal and commercial projects.