MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / ToggleGroup

Function ToggleGroup

packages/react/src/components/toggle-group.tsx:20–49  ·  view source on GitHub ↗
({
  className,
  variant,
  size,
  spacing = 0,
  children,
  ...props
}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
  VariantProps<typeof toggleVariants> & {
    spacing?: number;
  })

Source from the content-addressed store, hash-verified

18});
19
20function ToggleGroup({
21 className,
22 variant,
23 size,
24 spacing = 0,
25 children,
26 ...props
27}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
28 VariantProps<typeof toggleVariants> & {
29 spacing?: number;
30 }) {
31 return (
32 <ToggleGroupPrimitive.Root
33 data-slot="toggle-group"
34 data-variant={variant}
35 data-size={size}
36 data-spacing={spacing}
37 style={{ "--gap": spacing } as React.CSSProperties}
38 className={cn(
39 "group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",
40 className,
41 )}
42 {...props}
43 >
44 <ToggleGroupContext.Provider value={{ variant, size, spacing }}>
45 {children}
46 </ToggleGroupContext.Provider>
47 </ToggleGroupPrimitive.Root>
48 );
49}
50
51function ToggleGroupItem({
52 className,

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected