Select Control

The button of a Select on its own, for a list of your own, with variants, sizes, start and dropdown icons, clearable, loading and invalid states.

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

One iOS menu, opened three ways: Menu from a button of actions, Select from a button that shows a value, as an iOS pop-up button, and Context Menu from a touch and hold or a secondary click on an element. Select Control is Select's button alone, for a list of your own. On a phone the three menus draw the same rows, described once under Menu › On a phone.

On Phone, a select control is the value of a row in a FieldGroup, as the Settings Forms do: the value and its up-down chevrons sit at the row's end, like an iOS pop-up button. The row sets the control's height, insets, type and colors, so the Phone previews show rows without the size, pill, variant, StartIcon, dropdown-icon-type, block and optically-align controls.

The same module exports DropdownIcon for custom menu triggers. Its icon-type accepts "dropdown" or "chevronDown"; the indicator keeps its proportions inside a Button.

Examples

Overview

Variants

Sample value

Sizing & roundness

None
Loading...
Today

Selected

Mango

Start icon

None
Today

Clearable

Today

Loading

Loading...

Invalid

Pineapple

Disabled

Reader

Block

None

Country selector

Country code selector

Phone form

Phone number

Phone number

Choose your country and enter the number you want to use.

+34

Optical alignment

System

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-on-enterbooleanfalseEnter interacts too, as on a combobox button. Off by default, as Enter may be an attempt to submit a form
@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))