Skip to content

Magnetic Split Button

Dual-action execution trigger featuring kinetic magnetic separation on hover, corner radius morphing, and an integrated contextual command dropdown.

Dependencies

motionlucide-reactclsxtailwind-merge

Interaction

Conjoined rest state with central hairline divider. Hovering or opening menu induces magnetic repulsion: primary button translates -4px with pill radius morphing while chevron translates +4px with reverse morphing. Central divider dissolves.

Props

PropTypeDescription
defaultActionstringInitial selected primary action label.
actionsMagneticSplitAction[]Dropdown secondary menu options array.
onAction(actionLabel: string) => voidCallback fired when primary button or menu item is clicked.
classNamestringAdditional classes applied to container.

MIT License. Free to use in personal and commercial projects. Built for Peel UI.