Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update toggle-group.tsx

Tim Wilsondd0c77148250
diff --git a/packages/ui/src/toggle-group.tsx b/packages/ui/src/toggle-group.tsx
index 3a84fba058..eefe7c4323 100644
--- a/packages/ui/src/toggle-group.tsx
+++ b/packages/ui/src/toggle-group.tsx
@@ -19,14 +19,17 @@ export function ToggleGroup({
const layoutGroupId = useId();
return (
- <div className="relative inline-flex items-center space-x-1 rounded-xl border border-gray-200 bg-white p-1">
- <LayoutGroup id={layoutGroupId}>
+ <LayoutGroup id={layoutGroupId}>
+ <motion.div
+ layout
+ className="relative inline-flex items-center gap-1 rounded-xl border border-gray-200 bg-white p-1"
+ >
{options.map((option) => (
<button
key={option.value}
type="button"
className={cn(
- "relative z-10 px-3 py-1 text-sm font-medium capitalize",
+ "relative z-10 block px-3 py-1 text-sm font-medium capitalize",
{
"transition-all hover:text-gray-500": option.value !== selected,
},
@@ -44,7 +47,7 @@ export function ToggleGroup({
)}
</button>
))}
- </LayoutGroup>
- </div>
+ </motion.div>
+ </LayoutGroup>
);
}