Skip to content

Select ​

Displays a list of options to pick from. The list is at least as wide as its trigger, scrolls when long, and becomes a bottom sheet on compact touch screens.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Long lists ​

The data form is virtualized: only the rows in view exist, scrolled-out rows are reused, and the list opens at the selected option. Every 97th item is disabled.

Approximate web preview — the HarmonyOS rendering is the reference.

MANY_OPTIONS.length options · item = …

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SSelect ​

shadcn-vue Select. Two styles of use:

Anchored list on pointer / wide screens, bottom sheet on compact touch screens.

The data form renders its options with List + Repeat.virtualScroll() (ADR D14): only the visible rows exist, and the list opens scrolled to the selected option. The compound form builds every item (slot content cannot be virtualized) — use options for anything longer than a screenful.

Panel tokens (ADR D13/D14): --select-* (background border-color radius border-width padding shadowhighlight-background highlight-foreground max-height), falling back to the shared --menu-* surface; per instance via tokens.

PropTypeDefaultDescription
value!!string | undefinedundefined
defaultValuestring''
placeholderResourceStr$r('app.string.spark_select_placeholder')
optionsSparkSelectOption[][]data-driven mode: renders its own trigger + (virtualized) content
disabledbooleanfalse
adaptiveSparkAdaptive
SparkAdaptive = 'auto' | 'pointer' | 'touch'
'auto'
tokensSparkOptionPanelTokens{}data mode: panel overrides (see SSelectContent)
EventTypeDefaultDescription
onValueChange(v: string) => void() => { }

Slots: children (trailing closure)

SSelectTrigger ​

Input-styled trigger showing the selected label (or the placeholder) and a chevron.

PropTypeDefaultDescription
placeholderResourceStr$r('app.string.spark_select_placeholder')
sizing'default' | 'sm''default''default' h-9, 'sm' h-8

SSelectContent ​

The option list: as wide as the trigger (at least), anchored below it; bottom sheet on compact touch. With options (what SSelect({ options }) passes) the rows are virtualized; otherwise the slot is rendered.

tokens / --select-* → --menu-* → bg-popover rounded-md border p-1 shadow-md.

PropTypeDefaultDescription
adaptiveSparkAdaptive
SparkAdaptive = 'auto' | 'pointer' | 'touch'
'auto'
maxListHeightnumber320max list height before scrolling (vp); --select-max-height / tokens.maxHeight override it
optionsSparkSelectOption[][]data mode: virtualized rows instead of the slot
tokensSparkOptionPanelTokens{}

Slots: children (trailing closure)

SSelectItem ​

One option of the compound form (same row as the data form: check on the right, opacity fade on press).

PropTypeDefaultDescription
valuestring''
textstring''
disabledbooleanfalse

SSelectLabel ​

PropTypeDefaultDescription
textResourceStr''

SSelectSeparator ​

No props.

SSelectGroup ​

Slots: children (trailing closure)

MIT Licensed