Gsap Toggle

FreeNew

Preview live, install via shadcn or copy the source.

Installation

Install via shadcn

This will install the component and its dependencies automatically.

Usage

gsap-toggle-usage.tsxTSX

Props

NameTypeDefaultRequiredDescription
optionsGsapToggleOption[]NoArray of options with value, label and optional badge. Defaults to Quarterly / Yearly with -33% badge.
valuestringNoControlled selected value.
defaultValuestringNoInitial value for uncontrolled usage.
onValueChange(value: string) => voidNoCallback when selection changes.
size"sm" | "default" | "lg"defaultNoSize variant controlling padding and typography.
equalWidthbooleanfalseNoWhen true each segment shares equal width (flex-1).
fullWidthbooleanfalseNoStretch container to full width.
disabledbooleanfalseNoDisable the whole control.
animateScalebooleantrueNoSubtle scale animation on active label.
durationnumber0.38NoGSAP duration for pill slide.
easestringpower3.inOutNoGSAP easing for pill slide.
containerClassNamestringNoExtra classes for the outer pill track container.
pillClassNamestringNoClasses for the sliding active pill (default bg-black).
itemClassNamestringNoBase classes for each option button.
activeItemClassNamestringNoClasses applied when option is active.
inactiveItemClassNamestringNoClasses applied when inactive.
badgeClassNamestringNoBase badge classes.
badgeActiveClassNamestringNoBadge classes when active.
badgeInactiveClassNamestringNoBadge classes when inactive.
ariaLabelstringNoAccessible label for the radiogroup.
namestringNoName attribute for radio semantics.
classNamestringNoAdditional classes merged into the container.
© reframe/ui 2026Built by @thommysart
More in Buttons & Links