Skip to content

Segmented Control

Switches between mutually exclusive modes.

Usage

vue
<script setup>
import { ref } from "vue";
import { ArchSegmentedControl } from "@archora/ui";

const mode = ref("daily");
const options = [
  { value: "daily", label: "Daily" },
  { value: "weekly", label: "Weekly" }
];
</script>

<template>
  <ArchSegmentedControl v-model="mode" :options="options" />
</template>

Live sandbox

Segmented Control can be tested directly on this page.

interactive
<SegmentedControl />

Props

PropTypeDefaultDescription
options{ value: string; label: string; disabled?: boolean }[]-Option list.
modelValuestring-v-model value.
size"sm" | "md" | "lg""md"Size.
variant"solid" | "outline" | "ghost""solid"Visual variant.
disabledbooleanfalseDisables the component.
fullWidthbooleanfalseStretches the control to full width.
ariaLabelstring-aria-label.
ariaLabelledbystring-aria-labelledby.

Events

EventPayloadDescription
update:modelValuevalue: stringmodelValue change.
changevalue: stringValue change.