Appearance
Select
SCASelect is a single-choice dropdown with a label, helper text and optional search, built from SCAInputWrapper and a trigger input. Icon names are typed (IconName); see Icons.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | string | number | — | id of the selected item. v-model. |
items | SelectableItem[] | — | Options. Required. |
label | string | — | Label. |
labelPosition | 'top' | 'left' | 'hidden' | — | Where the label sits. |
appearance | 'border' | 'typo-header-xlarge' | 'no-border' | 'bottom-border' | — | Trigger style. |
placeholder | string | — | Text while nothing is selected. |
icon | IconName | — | Icon at the start of the trigger. |
search | 'client' | 'custom' | — | Make the trigger searchable: client filters by label, custom leaves filtering to you. |
searchTerm | string | '' | Search text. v-model:search-term. |
required / optionalLabelText | boolean / string | false / — | Required mark, or the text of the optional hint. |
helperText | string | Ref<string> | — | Text under the field. |
validationError | boolean | false | Show helperText as an error. |
alert | boolean | false | Alert (error) underline without a message. |
disabled | boolean | false | Disable the field. |
htmlFor | string | — | id of the trigger input, for an external <label>. |
tooltip / helpLink | string | — | Label tooltip / help link. |
hidePopoverOnValueChange | boolean | true | Close the list after a choice. |
hasMore / loadingMore | boolean | false | Paged lists: more items exist / loading them. |
itemIconSize | string | — | Size of the item icons. |
useSmallerVerticalPadding | boolean | false | Denser items. |
disableHoverColorTag | boolean | false | No hover colour on the coloured closed tag. |
truncateClosedTag | boolean | false | Truncate a long closed tag. |
noMobileMargin | boolean | false | Drop the mobile bottom margin. |
SelectableItem
| Field | Type | Description |
|---|---|---|
id | string | number | Value. |
label | string | Text. |
icon | IconName | Icon before the label. |
avatarInitials | string | Avatar before the label. |
color | StatusColor | Show the item as a coloured tag (status). |
hidden | boolean | Left out of the list. |
disabled | boolean | Listed but not selectable. |
Emits
| Event | Payload | When |
|---|---|---|
update:modelValue | string | number | An item is chosen. |
update:searchTerm | string | The search text changes. |
opened / closed | — | The list opens / closes. |
loadMore | — | The end of the list is reached while hasMore. |
Slots
| Slot | Description |
|---|---|
triggerContent | Replace the selected value in the trigger (item: the selected item). |
tag | Render each item (item) as a tag. |
input / after | Extra content inside the trigger. |
Item Objects
Placeholder
Preselected Item
Icon
Item icons, avatars and disabled items
Required
Disabled
HTML for
search
search = client
Filters the items automaticaly in the component itself by the search term
search = custom
Ignores filtering the items. Use the v-model:search-termto filter the items by hand.
Helper Text
hidePopoverOnValueChange (default: true)
Prevents the popover from hiding after clicking on an option.