Skip to content

Subsection Segment Control

A lighter switching control than Tabs, without content area. Supports three styles: default (bottom highlight bar), button (filled background), pill (capsule slider).

Basic Usage

vue
<template>
  <see-subsection v-model="active" :options="options" />
</template>

<script setup>
import { ref } from 'vue'
const active = ref('one')
const options = [
  { label: 'Option One', value: 'one' },
  { label: 'Option Two', value: 'two' },
  { label: 'Option Three', value: 'three' }
]
</script>

Button Style

vue
<template>
  <see-subsection v-model="active" :options="options" type="button" />
</template>

Pill Style

vue
<template>
  <see-subsection v-model="active" :options="options" type="pill" />
</template>

SubsectionOption

PropertyTypeDescription
labelstringDisplay text
valuestring | numberOption value
isDisabledbooleanWhether disabled

Props

PropertyTypeDefaultDescription
modelValuestring | number''Currently selected value
optionsSubsectionOption[][]Option list
type'default' | 'button' | 'pill''default'Style type
size'small' | 'default' | 'large''default'Size
activeColorstring''Background color when active
isDisabledbooleanfalseWhether all disabled
isFullWidthbooleanfalseWhether to fill full width

Events

EventParametersDescription
onChangevalue, optionOption switch
update:modelValuevaluev-model update

Liao ICP No. 2025070134