Skip to content

Select

Select an item in a dropdown list. Use with Field to access all functionalities

Examples

Base

Something went wrong with this field

Show code

Grouped

Selected:

Show code

Multiple

Selected: []

Show code

Sizes

Show code

Variants

Show code

Class props

'Classes applied to the element'
How does the Class props inspector work?
Class propDescriptionPropsSuffixes
arrowClassClass of the select arrow.
👉 It applies the arrow icon using background-image and background-position on select element. An alternative to override it is iconRight prop (globally or not)
disabledClassClass of select when disabled .disabled
expandedClassClass of select when expanded.expanded
iconLeftClassClass of the left icon.icon
iconLeftSpaceClassClass of the left icon space inside the select.icon
iconRightClassClass of the right icon.iconRight
iconRightSpaceClassClass of the right icon space inside the select.iconRight
multipleClassClass of the select when multiple mode is active.multiple
placeholderClassClass of the select placeholder.
rootClassClass of the root element.
roundedClassClass of select when rounded.rounded
selectClassClass of the native select element.
sizeClassClass of the select size.sizesmall
medium
large
variantClassClass of the select variant.variantprimary
info
warning
danger

Select component

Select an item in a dropdown list. Use with Field to access all functionalities

html
<o-select></o-select>

Props

Prop nameDescriptionTypeValuesDefault
autocompleteSame as native autocomplete options to use in HTML5 validationstring-
From config:
select: {
  autocomplete: "off"
}
disabledDisable the input - same as native disabledboolean-false
expandedMakes input full width when inside a grouped or addon fieldboolean-false
iconIcon to be shownstring-
From config:
select: {
  icon: undefined
}
iconClickableMakes the icon clickableboolean-false
iconPackIcon pack to usestringmdi, fa, fas and any other custom icon pack
From config:
select: {
  iconPack: undefined
}
iconRightIcon to be added on the right sidestring-
From config:
select: {
  iconRight: undefined
}
iconRightClickableMake the icon right clickableboolean-false
iconRightVariantVariant of right iconstring-
idSame as native id. Also set the for label for o-field wrapper.string-uuid()
v-modelThe input value statestring | number | object | (string | number | object)[]-null
multipleAllow multiple selection - converts the modelValue into an arrayboolean-
nativeSizeSame as native sizestring | number-
optionsSelect options, unnecessary when default slot is usedstring[] | OptionsItem<string | number | object>[]-
overrideOverride existing theme classes completelyboolean-
placeholderText when nothing is selectedstring-
requiredSame as native requiredboolean-false
roundedMakes the element roundedboolean-false
sizeVertical size of inputstringsmall, medium, large
From config:
select: {
  size: undefined
}
statusIconShow status icon using field and variant propboolean-
From config:
{
  statusIcon: true
}
useHtml5ValidationEnable html 5 native validationboolean-
From config:
{
  useHtml5Validation: true
}
validationMessageThe message which is shown when a validation error occursstring-
variantColor of the controlstringprimary, info, success, warning, danger, and any other custom color
From config:
select: {
  variant: undefined
}

Events

Event namePropertiesDescription
update:modelValuevalue string | number | boolean | object | array - updated modelValue propmodelValue prop two-way binding
focusevent Event - native eventon input focus event
blurevent Event - native eventon input blur event
invalidevent Event - native eventon input invalid event
icon-clickevent Event - native eventon icon click event
icon-right-clickevent Event - native eventon icon right click event

Slots

NameDescriptionBindings
placeholderOverride the placeholder
defaultOverride the options, default is options prop

Sass variables

Current theme ➜ Oruga

SASS VariableDefault
$select-background-color#fff
$select-border-colorvar(--#{$prefix}grey-lighter)
$select-border-stylesolid
$select-border-width1px
$select-border-radiusvar(--#{$prefix}base-border-radius)
$select-rounded-border-radiusvar( --#{$prefix}base-border-radius-rounded)
$select-box-shadow$control-box-shadow
$select-color#363636
$select-icon-zindex4
$select-height$control-height
$select-line-heightvar(--#{$prefix}base-line-height)
$select-margin0
$select-padding$control-padding-vertical $control-padding-horizontal
$select-arrow-color$select-color
$select-arrow-size1rem
$select-placeholder-opacityvar(--#{$prefix}base-disabled-opacity)

See ➜ 📄 Full scss file

Current theme ➜ Bulma

The theme does not have any custom variables for this component.

Current theme ➜ Bootstrap

The theme does not have any custom variables for this component.

Released under the MIT License.