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

Function ToggleGroupItem

packages/react/src/components/toggle-group.tsx:51–80  ·  view source on GitHub ↗
({
  className,
  children,
  variant,
  size,
  ...props
}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>)

Source from the content-addressed store, hash-verified

49}
50
51function ToggleGroupItem({
52 className,
53 children,
54 variant,
55 size,
56 ...props
57}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>) {
58 const context = React.useContext(ToggleGroupContext);
59
60 return (
61 <ToggleGroupPrimitive.Item
62 data-slot="toggle-group-item"
63 data-variant={context.variant || variant}
64 data-size={context.size || size}
65 data-spacing={context.spacing}
66 className={cn(
67 toggleVariants({
68 variant: context.variant || variant,
69 size: context.size || size,
70 }),
71 "w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10",
72 "data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",
73 className,
74 )}
75 {...props}
76 >
77 {children}
78 </ToggleGroupPrimitive.Item>
79 );
80}
81
82export { ToggleGroup, ToggleGroupItem };

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected