BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn/ui/toggle-group

toggle-group

showcase-elevenlabs/toggle-group
FreeComponent

shadcn/ui publishes no description for this item.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/elevenlabs/showcase/main/apps/www/public/r/styles/new-york/toggle-group.json

Source

ui/toggle-group.tsxraw.githubusercontent.com/elevenlabs/showcase/main/apps/www/public/r/styles/new-york/toggle-group.json
1"use client"
2
3import * as React from "react"
4import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
5import { type VariantProps } from "class-variance-authority"
6
7import { cn } from "@/lib/utils"
8import { toggleVariants } from "@/registry/new-york/ui/toggle"
9
10const ToggleGroupContext = React.createContext<
11 VariantProps<typeof toggleVariants>
12>({
13 size: "default",
14 variant: "default",
15})
16
17const ToggleGroup = React.forwardRef<
18 React.ElementRef<typeof ToggleGroupPrimitive.Root>,
19 React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
20 VariantProps<typeof toggleVariants>
21>(({ className, variant, size, children, ...props }, ref) => (
22 <ToggleGroupPrimitive.Root
23 ref={ref}
24 className={cn("flex items-center justify-center gap-1", className)}
25 {...props}
26 >
27 <ToggleGroupContext.Provider value={{ variant, size }}>
28 {children}
29 </ToggleGroupContext.Provider>
30 </ToggleGroupPrimitive.Root>
31))
32
33ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName
34
35const ToggleGroupItem = React.forwardRef<
36 React.ElementRef<typeof ToggleGroupPrimitive.Item>,
37 React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
38 VariantProps<typeof toggleVariants>
39>(({ className, children, variant, size, ...props }, ref) => {
40 const context = React.useContext(ToggleGroupContext)
41
42 return (
43 <ToggleGroupPrimitive.Item
44 ref={ref}
45 className={cn(
46 toggleVariants({
47 variant: context.variant || variant,
48 size: context.size || size,
49 }),
50 className
51 )}
52 {...props}
53 >
54 {children}
55 </ToggleGroupPrimitive.Item>
56 )
57})
58
59ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName
60
61export { ToggleGroup, ToggleGroupItem }

What it pulls in

npm packages

  • @radix-ui/react-toggle-group

Other registry items

  • toggle

Files it writes

  • registry/new-york/ui/toggle-group.tsx

Facts

Registry
shadcn/ui
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
today

Go to the source

showcase.elevenlabs.io elevenlabs/showcase on GitHub Raw registry item This item as JSON

More from shadcn/ui

All 357 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionshadcn/uiComponentsFree1 dep
alertalertshadcn/uiComponentsFreeno deps
alert-dialogalert-dialogshadcn/uiComponentsFree1 dep
aspect-ratioaspect-ratioshadcn/uiComponentsFree1 dep
avataravatarshadcn/uiComponentsFree1 dep
badgebadgeshadcn/uiComponentsFree1 dep
breadcrumbbreadcrumbshadcn/uiComponentsFree1 dep
buttonbuttonshadcn/uiComponentsFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex