toggle-group
shadcn-vue/toggle-groupFreeComponent
shadcn-vue publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shadcn-vue on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://shadcn-vue.com/r/styles/new-york/toggle-group.jsonSource
1<script setup lang="ts">2import type { VariantProps } from "class-variance-authority"3import type { ToggleGroupRootEmits, ToggleGroupRootProps } from "reka-ui"4import type { HTMLAttributes } from "vue"5import type { toggleVariants } from "@/registry/new-york/ui/toggle"6import { reactiveOmit } from "@vueuse/core"7import { ToggleGroupRoot, useForwardPropsEmits } from "reka-ui"8import { provide } from "vue"9import { cn } from "@/lib/utils"1011type ToggleGroupVariants = VariantProps<typeof toggleVariants>1213const props = defineProps<ToggleGroupRootProps & {14 class?: HTMLAttributes["class"]15 variant?: ToggleGroupVariants["variant"]16 size?: ToggleGroupVariants["size"]17}>()18const emits = defineEmits<ToggleGroupRootEmits>()1920provide("toggleGroup", {21 variant: props.variant,22 size: props.size,23})2425const delegatedProps = reactiveOmit(props, "class")2627const forwarded = useForwardPropsEmits(delegatedProps, emits)28</script>2930<template>31 <ToggleGroupRoot v-slot="slotProps" v-bind="forwarded" :class="cn('flex items-center justify-center gap-1', props.class)">32 <slot v-bind="slotProps" />33 </ToggleGroupRoot>34</template>
What it pulls in
npm packages
Other registry items
Files it writes
More from shadcn-vue
All 66 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn-vue | Components | Free | 2 deps · 5 files | |
| alertalert | shadcn-vue | Components | Free | no deps · 4 files | |
| alert-dialogalert-dialog | shadcn-vue | Components | Free | 2 deps · 10 files | |
| aspect-ratioaspect-ratio | shadcn-vue | Components | Free | 1 dep · 2 files | |
| attachmentattachment | shadcn-vue | Components | Free | 1 dep · 10 files | |
| avataravatar | shadcn-vue | Components | Free | 2 deps · 4 files | |
| badgebadge | shadcn-vue | Components | Free | 2 deps · 2 files | |
| breadcrumbbreadcrumb | shadcn-vue | Components | Free | 1 dep · 8 files |
