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/vue/components/SelectControl";

Examples

Overview

Variants

Sizing & roundness

size
variant

Selected

Start icon

dropdownIconType

Clearable

Loading

Invalid

Disabled

Block

Country selector

size
variant

Country code selector

size
variant

Phone form

size

Optical alignment

opticallyAlign

API

Use SelectControl with any floating UI (e.g. MenuTrigger, PopoverTrigger). The control renders the trigger; you provide the dropdown content. The default slot is the control's content. Attributes and listeners that are not props land on the control's <span role="button">; @keydown receives only the keys the control does not handle itself. To decide when the control opens (or to keep it closed), listen to @interact 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
StartIconComponent—Icon at start
@clear-click() => void—Enables the clear button when set (a function prop, onClearClick)
@interact() => void—Called on pointer down, ArrowDown, ArrowUp and Space (a function prop, onInteract). Without it, a wrapping trigger opens on pointer down
dropdown-icon-type"chevronDown" | "dropdown" | "none""dropdown"Dropdown indicator style
invalidbooleanfalseInvalid state
disabledbooleanfalseDisable control
blockbooleanfalseFull width
loadingbooleanfalseLoading state (aria-busy); hides the indicators and ignores interaction
optically-align"start" | "end"—Optical alignment
classstring—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))