Tessera UI

Select

Keyboard-accessible dropdown select with intent variants, sizes, grouped options, leading icons, item descriptions, and label position options.

Installation

pnpm add @tessinaui/ui

Usage

import {
  SelectRoot,
  SelectTrigger,
  SelectPopup,
  SelectScrollUpArrow,
  SelectScrollDownArrow,
  SelectList,
  SelectItem,
  SelectGroup,
  SelectGroupLabel,
  SelectSeparator,
} from "@tessinaui/ui";
{/* Basic */}
<SelectRoot label="Fruit" value={value} onValueChange={setValue}>
  <SelectTrigger placeholder="Select a fruit…" />
  <SelectPopup>
    <SelectList>
      <SelectItem value="apple">Apple</SelectItem>
      <SelectItem value="banana">Banana</SelectItem>
      <SelectItem value="cherry">Cherry</SelectItem>
    </SelectList>
  </SelectPopup>
</SelectRoot>

{/* Grouped with scroll arrows */}
<SelectRoot label="Region" value={value} onValueChange={setValue}>
  <SelectTrigger placeholder="Select a region…" />
  <SelectPopup>
    <SelectScrollUpArrow />
    <SelectList>
      <SelectGroup>
        <SelectGroupLabel>Europe</SelectGroupLabel>
        <SelectItem value="fr">France</SelectItem>
        <SelectItem value="de">Germany</SelectItem>
      </SelectGroup>
      <SelectSeparator />
      <SelectGroup>
        <SelectGroupLabel>Asia Pacific</SelectGroupLabel>
        <SelectItem value="jp">Japan</SelectItem>
        <SelectItem value="au">Australia</SelectItem>
      </SelectGroup>
    </SelectList>
    <SelectScrollDownArrow />
  </SelectPopup>
</SelectRoot>

Playground

Preview

Showcase

Preview

API Reference

SelectRoot props

PropTypeDefaultDescription
size"xs" | "sm" | "md" | "lg" | "xl""md"Trigger height and text scale
intent"none" | "error" | "warning" | "success" | "info""none"Border and focus-ring colour
rounded"none" | "sm" | "md" | "lg" | "full""full"Border radius of the trigger
labelPosition"outside-top" | "inside" | "outside-left""outside-top"Label layout relative to the trigger
labelstringLabel text
requiredbooleanAppends * to label
infoTextstringInline hint shown beside the label
supportingTextstringHelper / validation text below the trigger
valuestring | nullControlled selected value
defaultValuestring | nullUncontrolled initial value
onValueChange(value: string | null) => voidCalled when selection changes
disabledbooleanDisables the whole select
namestringNative form field name
dir"ltr" | "rtl""ltr"Text direction
wrapperClassNamestringClass for the outermost wrapper div

SelectTrigger props

PropTypeDescription
leadingIconReactNodeIcon at the start of the trigger, before the value
placeholderstringText shown when no value is selected
classNamestringExtra classes on the trigger button

SelectItem props

PropTypeDescription
valuestringThe value this item represents
disabledbooleanPrevents selection
leadingIconReactNodeIcon shown before the label
leadingAvatarReactNodeAvatar shown before the label
descriptionstringSecondary text rendered below the item label

SelectPopup props

PropTypeDescription
positionerPropsobjectForwarded to the Positioner element (e.g. sideOffset, alignOffset)
classNamestringExtra classes on the popup panel

SelectList props

PropTypeDescription
classNamestringUseful for capping height: className="max-h-60"

All other sub-components (SelectGroup, SelectGroupLabel, SelectSeparator, SelectScrollUpArrow, SelectScrollDownArrow, SelectSupportingText) forward all standard HTML element props plus className.

On this page