Segmented
State belongs to the parent. Compose this component with the props and slots below.
Preview
Usage
<script setup lang="ts">
import { ref } from 'vue'
import { FzSegmented } from '@chrisdalbano/forza-ui'
import type { ForzaOption } from '@chrisdalbano/forza-ui'
const view = ref<string>('grid')
const options: ForzaOption[] = [
{ value: 'grid', label: 'Grid' },
{ value: 'list', label: 'List' },
]
</script>
<template>
<FzSegmented v-model="view" label="Layout" :options="options" />
</template>Import the shared stylesheet once and wrap your app in .fz-theme. See installation.
Props
| Name | Type | Required | Default |
|---|---|---|---|
label | string | Yes | None |
options | readonly { value: string; label: string; }[] | Yes | None |
modelValue | string | Yes | None |
Events and state
v-model: string
update:modelValue:[value: string]
Slots
none
Add from source
sh
forza add segmentedSet up the CLI first. Generated API tables come from the Vue source, using Vue Language Tools.