Select Control

Select control primitive for building custom dropdowns, with variants, sizing, start and dropdown icons, and clearable, loading, and invalid states.

import { SelectControl } from "@plexui/ui/components/SelectControl";

Examples

Overview

Variants

soft
Sample value
outline
Sample value
ghost
Sample value

Sizing & roundness

size
variant
Select...Select...
Select...
Tool callsWith tool calls
Today
Today

Selected

Select...

Start icon

Select date...
dropdownIconType
Select date...

Clearable

Selected value

Loading

Loading...

Invalid

Pineapple on pizza

Disabled

Reader

Block

Select...

Country selector

size
variant

Country code selector

size
variant

Phone form

size
+34

Optical alignment

opticallyAlign
Default
Ghost control
opticallyAlign="start"
Ghost control

API

Use SelectControl with any floating UI (e.g. Menu, Popover). The control renders the trigger; you provide the dropdown content. children is the control's content. Other props land on the control's <span role="button">; onKeyDown receives only the keys the control does not handle itself. To decide when the control opens (or to keep it closed), pass onInteract and control the dropdown's open state yourself: the wrapping trigger then no longer opens on its own.

PropTypeDefaultDescription
selectedbooleanfalseWhether a value is selected (affects placeholder styling)
variant"soft" | "outline" | "ghost""outline"Visual variant
sizeControlSize"md"Control size (3xs to 3xl)
pillbooleanfalseFully rounded trigger
StartIconComponentType—Icon at start
onClearClick() => void—Enables the clear button when set
onInteract() => void—Called on pointer down, ArrowDown, ArrowUp and Space. Without it, a wrapping trigger opens on pointer down
dropdownIconType"chevronDown" | "dropdown" | "none""dropdown"Dropdown indicator style
invalidbooleanfalseInvalid state
disabledbooleanfalseDisable control
blockbooleanfalseFull width
loadingbooleanfalseLoading state (aria-busy); hides the indicators and ignores interaction
opticallyAlign"start" | "end"—Optical alignment
classNamestring—Applied to the control

SelectControl shares the unified 9-step size scale with Button, Input, Select, and SegmentedControl.

Styling

Select Control reads these component tokens. Override them at any scope to restyle it:

  • --input-border-color-invalid: border color invalid (default var(--color-border-danger-outline))
  • --input-outline-border-color: outline border color (default var(--color-border-primary-outline))
  • --input-outline-border-color-hover: outline border color hover (default light-dark(var(--alpha-25), var(--alpha-30)))
  • --input-placeholder-text-color: placeholder text color (default var(--color-text-tertiary))
  • --input-text-color: text color (default var(--color-text))
  • --select-control-font-weight: font weight (default var(--font-weight-normal))