Revel
GitHub
GitHub
  • Overview

    • Getting started
    • FAQ
    • Release notes
  • Foundations

    • Meet the standard
    • Accessibility
    • Internationalization
    • Information hierarchy
    • Speed
  • Design

    • Visual principles
    • Colors
    • Space
    • Icons
    • Typography
  • Design tokens
  • Style helpers
  • Content

    • Express your ideas
    • Actionable language
    • Inclusive and accessible language
    • Alternative text
    • Grammar and mechanics
      • Basics
      • Capitalization
      • Dates and units of measurement
      • Punctuation
  • Components

    • Alert
    • Avatar
    • Badge
    • Button
    • Button group
    • Checkbox
    • Date Input
      • dates
      • datetimes
      • ranges
    • Field group
    • File upload
    • Flex
    • Grid
    • Icon
    • Image
    • Input
    • Loader
    • Modal
    • Month picker
    • Pagination
    • Popper
    • Radio
    • Repeater
    • Select
    • Tabs
    • Tile
    • Toast
    • Toggle
  • Directives

    • Click outside
    • Tooltip

Select

Display all possible options in one component with ability select one or multiple values.

List of features:

  • Typeahead value filter
  • Child content override via slots
  • Tags as selection items
  • Async data process
select-simple.vue
select-multiple.vue
select-async.vue
select-validation.vue

API

Props

NameTypeOptionsDefaultDescription
allowEmptybooleantrue

Specify if no option can be selected

autocompletestring'off'

Specify autocomplete value

blockKeysstring[]function() { return []; }

List of keys where default behavior will be ignored

clearOnSelectbooleantrue

Specify if on select the search input should be cleaned up

closeOnSelectbooleantrue

Specify if the popper should be closed after selection

customLabelCustomlabelFnfunction(option, label) { if (isEmpty(option)) { return ''; } return typeof option === 'object' && option[label] ? option[label] : option; }

If the option is an object specify what property should be used as a label, by default 'label'

validateValidationStatenull

Specify how to validate the select field

showValidateMessagesbooleanfalse

Show validation messages

disabledbooleanfalse

Disable the select field

helpTextstringnull

Change the help text

hideSelectedbooleanfalse

Specify if selected options should be hidden

idstring() => nanoid()

ID of select field

internalSearchbooleantrue

Specify is the internal search enabled

labelstring''

Change the label of the select field

limitnumber99999

Specify the limit quantity of shown selected options

limitTextfuncgetLimitText

Set the text which is shown when there are not shown options by limit

loadingbooleanfalse

Set the loading state

maxnumber | booleanfalse

Specify maximum for selected options

maxHeightnumber300

Specify max height of the popper

multiplebooleanfalse

Specify is multiple mode is enabled

namestring''

Change the name of select

openDirectionstring 'above', 'top', 'below', 'bottom'''

Specify direction of shown popper

optionsOptions() => []

Set the options of select field

optionHeightnumber40

Specify height of options in the popper

optionKeystring''

If the option is an object specify what property should be used as a value, by default 'value'

optionLabelstring''

If the option is an object specify what property should be used as a label, by default 'label'

optionsLimitnumber1000

Set the limit of available shown options

preselectFirstbooleanfalse

Specify if the first option should be preselected

preserveSearchbooleanfalse

Specify if the search should be preserved

placeholderstring'Select option'

Change the placeholder

resetAfterbooleanfalse

Specify if the selection should be reset

searchablebooleantrue

Specify if the field searchable

showNoOptionsbooleantrue

Specify if the no option label should be shown

showNoResultsbooleantrue

Specify if the no results label should be shown

showPointerbooleantrue

Specify should the pointer be shown

tabindexnumber0

Specify tab index

taggablebooleanfalse

Specify should the user create his own options - tags

tagPositionstring'top'

Specify tag position

tagValidatorTagValidatorFn() => true

Specify how the tag is validating

modelValueNullable<Options | OptionItem>function() { return []; }

The array of selected options

asyncFindAsyncSearchFnnull

asyncConfigConfig() => ({})

asyncValuePropsKeystring''

trackAsyncUpdatesByObjectbooleanfalse

Used to receive object in update:modelValue event, but not just the option key

Slots

NameDescription
remove

Override default remove icon

caret

Override default caret component

clear

Add an icon to clear the input

selection

Override default selection component

tag

Override default tag component

limit

Override default limit message component

loading

Override default loading spinner component

singleLabel

Override default single value component

placeholder

Override default placeholder component

beforeList

Override default before list option component

maxElements

Override default max elements message component

option

Override default option component

noResult

Override default no result component

noOptions

Override default no options component

afterList

Override default after list component

Events

NameDescription
update:modelValueThe option select
search-changeSearch text change
openThe select popper open
closeThe select popper close
removeThe selected option remove
tagThe option tag
async-loaded
selectThe option select
Edit this page
Last Updated: 1/30/25, 6:26 PM
Contributors: Dasha Baklanova, John Hannagan, Weetbix, Cesar Level
Prev
Repeater
Next
Tabs