Skip to content

Complex Selector

@astryxdesign/core v0.7.1 · ComplexSelector

Props ​

NameTypeDefaultDescription
labelstring-Field label. It also names the popup.
modelValueValue-Current value. Bind with v-model.
triggerLabelstring-Text on the trigger. Falls back to placeholder.
placeholderstringSelect…Shown when triggerLabel is empty.
isLabelHiddenbooleanfalseHide the visible label. The accessible name stays.
descriptionstring-Supporting text under the label.
isOptionalbooleanfalseMarks the field optional.
isRequiredbooleanfalseMarks the field required.
isDisabledbooleanfalseThe trigger does not open.
isLoadingbooleanfalseShows a spinner on the trigger.
statusFieldStatusInput-Error, warning, or success message.
statusVariant'attached' | 'detached' | 'tooltip''attached'Where the status message sits.
labelTooltipstring-Tooltip on the label.
size'sm' | 'md' | 'lg''md'Trigger size.
widthnumber | string-Field width. Numbers are pixels.
placementPopoverPlacement'below'Where the popup opens.
alignment'start' | 'center' | 'end''start'Popup alignment along the placement axis.
startIconstring | Component-Icon at the start of the built-in trigger.
variant'input' | 'secondary' | 'ghost''input'input is the bordered field. secondary matches a secondary button. ghost matches a toolbar button. On the latter two, an attached status becomes detached.
containerClass / controlClassclass—The shell takes container* and the root class. The built-in button takes control*. A custom trigger ignores both and warns in development.
renderTrigger(props) => VNode-Replaces the field and the built-in trigger. Spread props onto your control. The trigger slot does the same job.
handleRefRef | (handle) => void-Receives open, close, toggle, and isOpen. A template ref exposes the same methods.
changeAction(value) => void | Promise<void>-Runs after the value changes. While it is pending the trigger shows a spinner.

Events ​

NamePayloadDescription
update:modelValueValueThe value passed to commit.
changeValueEmitted with update:modelValue.
clickevent: MouseEventEmitted for a click on the trigger, before the popup opens. Call event.preventDefault() to keep it closed. With the trigger slot or renderTrigger it runs after the toggle and cannot cancel it.
keydownevent: KeyboardEventEmitted for keys on the trigger after the built-in handling, and receives every key, including the ArrowDown that opens the popup. With a custom trigger, keys the built-in handling cancels are not emitted.
openChangeisOpen: booleanEmitted whenever the surface opens or closes, however it happened: trigger, keyboard, light dismiss, Escape, close(), or the imperative handle.

Slot ​

The default slot receives value, commit, close, and state. state is { isOpen, isBusy, triggerId, contentId }. value includes a pending optimistic value.