MCPcopy Create free account
hub / github.com/code-with-antonio/nodebase / ToggleGroupItem

Function ToggleGroupItem

src/components/ui/toggle-group.tsx:43–71  ·  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

41}
42
43function ToggleGroupItem({
44 className,
45 children,
46 variant,
47 size,
48 ...props
49}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
50 VariantProps<typeof toggleVariants>) {
51 const context = React.useContext(ToggleGroupContext)
52
53 return (
54 <ToggleGroupPrimitive.Item
55 data-slot="toggle-group-item"
56 data-variant={context.variant || variant}
57 data-size={context.size || size}
58 className={cn(
59 toggleVariants({
60 variant: context.variant || variant,
61 size: context.size || size,
62 }),
63 "min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",
64 className
65 )}
66 {...props}
67 >
68 {children}
69 </ToggleGroupPrimitive.Item>
70 )
71}
72
73export { ToggleGroup, ToggleGroupItem }

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected