MCPcopy Create free account
hub / github.com/evolify/dumpfun / ToggleGroupItem

Function ToggleGroupItem

common/components/ui/toggle-group.tsx:41–69  ·  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

39}
40
41function ToggleGroupItem({
42 className,
43 children,
44 variant,
45 size,
46 ...props
47}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
48 VariantProps<typeof toggleVariants>) {
49 const context = React.useContext(ToggleGroupContext)
50
51 return (
52 <ToggleGroupPrimitive.Item
53 data-slot="toggle-group-item"
54 data-variant={context.variant || variant}
55 data-size={context.size || size}
56 className={cn(
57 toggleVariants({
58 variant: context.variant || variant,
59 size: context.size || size,
60 }),
61 "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",
62 className
63 )}
64 {...props}
65 >
66 {children}
67 </ToggleGroupPrimitive.Item>
68 )
69}
70
71export { ToggleGroup, ToggleGroupItem }

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected