This component no longer exists. It was in ondo-ui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-09 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
toggle-group
ondo-ui/toggle-groupRemovedComponent
A set of two-state buttons that can be toggled on or off.
Install it
npx shadcn@latest add https://ui.ondo.dou.so/r/toggle-group.jsonSource
1"use client"23import * as React from "react"4import { Toggle as TogglePrimitive } from "@base-ui/react/toggle"5import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group"6import { type VariantProps } from "class-variance-authority"78import { cn } from "@/lib/utils"9import { toggleVariants } from "@/components/ui/toggle"1011const ToggleGroupContext = React.createContext<12 VariantProps<typeof toggleVariants> & {13 spacing?: number14 orientation?: "horizontal" | "vertical"15 }16>({17 size: "default",18 variant: "default",19 spacing: 2,20 orientation: "horizontal",21})2223function ToggleGroup({24 className,25 variant,26 size,27 spacing = 2,28 orientation = "horizontal",29 children,30 ...props31}: ToggleGroupPrimitive.Props &32 VariantProps<typeof toggleVariants> & {33 spacing?: number34 orientation?: "horizontal" | "vertical"35 }) {36 return (37 <ToggleGroupPrimitive38 data-slot="toggle-group"39 data-variant={variant}40 data-size={size}41 data-spacing={spacing}42 data-orientation={orientation}43 style={{ "--gap": spacing } as React.CSSProperties}44 className={cn(45 "group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=0]:data-[variant=outline]:shadow-xs data-vertical:flex-col data-vertical:items-stretch",46 className47 )}48 {...props}49 >50 <ToggleGroupContext.Provider51 value={{ variant, size, spacing, orientation }}52 >53 {children}54 </ToggleGroupContext.Provider>55 </ToggleGroupPrimitive>56 )57}5859function ToggleGroupItem({60 className,61 children,62 variant = "default",63 size = "default",64 ...props65}: TogglePrimitive.Props & VariantProps<typeof toggleVariants>) {66 const context = React.useContext(ToggleGroupContext)6768 return (69 <TogglePrimitive70 data-slot="toggle-group-item"71 data-variant={context.variant || variant}72 data-size={context.size || size}73 data-spacing={context.spacing}74 className={cn(75// … truncated
What it pulls in
npm packages
Other registry items
