Trên trang này

Trang này chưa có bản tiếng Việt, nội dung bên dưới là bản tiếng Anh. Xem trang tiếng Anh

Toggle group

Install, props and the parts Toggle group is built from.

Install

Run this in the app, after shadcn-vue init and the Beehexa theme (Button › Code):

npx shadcn-vue@latest add https://beehexa.design/r/toggle-group.json

Use

<script setup lang="ts">
import { ref } from 'vue'
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group'
const types = ref(['orders'])
</script>

<template>
  <div>
    <ToggleGroup v-model="types" type="multiple" aria-label="Record types">
      <ToggleGroupItem value="orders">Orders</ToggleGroupItem>
      <ToggleGroupItem value="products">Products</ToggleGroupItem>
    </ToggleGroup>
  </div>
</template>

Props

Part Prop Values Notes
ToggleGroup type, v-model, spacing, variant, size single/multiple, string or string[], number spacing 0 joins the items

Built on

reka-ui ToggleGroupRoot, as the shadcn-vue Toggle group; items are Beehexa toggle buttons.