Segmented

Display multiple options and allow users to select a single option.

Basic Usage

Set v-model to the option value is selected.

Disabled

Set disabled of segmented or option to true to disable it.

Block

Set block to true to fit the width of parent element.

Custom Content

Set default slot to render custom content.

Custom Style

Set default slot to render custom content.

API

Attributes

NameDescriptionTypeDefault
model-value / v-modelbinding valuestring / number
optionsdata of the optionsarray[]
sizesize of componentenum''
blockfit width of parent contentboolean
disabledwhether segmented is disabledbooleanfalse
validate-eventwhether to trigger form validationbooleantrue
namenative name attributestring
idnative id attributestring
aria-label a11ynative aria-label attributestring

Events

NameDescriptionType
changetriggers when the selected value changes, the param is current selected valueFunction

Slots

NameDescription
defaultoption renderer

Type Declarations

Show declarations
type Option = {
  label: string
  value: string | number | boolean
  disabled?: boolean
  [key: string]: any
} | string | number | boolean | undefined

Source

ComponentDocs

Contributors