A button whose edge stretches toward the pointer like gum, ends in a round tip, and snaps back with a wobble when the pointer pulls away.
Move your pointerTouch and move
Retry failed webhooks with backoff
#482 · relay-api · fix/retry
gum-button, lively
Use Gum Button for the one main action of a section, where a little life in the control is welcome: merge a pull request, send an invoice, a call to action with room around it. The edge nearest the pointer swells toward it; once the pointer has touched the button and leaves, the edge sticks to it and stretches into a tongue with a round tip, then snaps back past rest and wobbles. The label and the clickable box never move, so it stays a plain, reliable button. Keep it to one or two per screen; for dense rows of secondary actions use the bubble preset or a regular button, and for a destination or a choice pick a component built for that.
pnpm dlx shadcn@latest add @motionkit-pro/gum-buttonnpx shadcn@latest add @motionkit-pro/gum-buttonyarn dlx shadcn@latest add @motionkit-pro/gum-buttonbunx --bun shadcn@latest add @motionkit-pro/gum-buttonRequires a Signature license and the @motionkit-pro registry with your token. See Installation.
import { GumButton } from "@/components/ui/gum-button"
export function MergeBox() {
return (
<div className="flex items-center justify-end gap-3">
<GumButton variant="outline">Close</GumButton>
<GumButton loading={merging} onClick={merge}>
Merge
</GumButton>
</div>
)
}Presets set how far the gum is felt and how far it pulls: gum (default, felt 72 px away, pulls 20 px), taffy (104 / 28 px, a thin long string for a big call to action with room around it) and bubble (48 / 12 px, a short wide bump for dense toolbars). reach and stretch (8-28 px) override the preset. variant is default (the tone surface) or outline (a pale tint of the tone with a tone rim); size is sm (32 px), md (40 px), lg (48 px) or icon (a 40 px ball).
loading sends an arc in the ink color round the edge, sets aria-busy and ignores clicks. hint (top, right, bottom, left) plays one pull and snap from that side each time it changes to a side, once the button is on screen: an onboarding nudge toward the next step. asChild renders a single child, such as a link, with the button's look and gum.
<GumButton preset="taffy" size="lg" hint={ready ? "right" : false}>
Send invoice
</GumButton>Set the character for the whole app with MotionKitProvider, or per instance with temperament (calm, lively, playful). It changes motion intensity only (calm pulls 40% of the stretch, playful 140%), never the drawing: the button at rest is identical in all three.
Prop
Type
Also accepts all props of ComponentProps<"button">.
The default demo: the merge box of a pull request, with the gum on its one main action. A hint pull from the right plays once when the box comes into view; merging shows the loading arc, then Revert and Delete branch take its place.
Move your pointerTouch and move
Retry failed webhooks with backoff
#482 · relay-api · fix/retry
gum-button, lively
An invoice with a toolbar of three bubble icon buttons, spaced so a bump never touches its neighbour, and a large taffy Send button in the footer.
Move your pointerTouch and move
INV-0042
Juniper & Vale · due 14 Nov
Draft · not sent yet
gum-button, lively
GumButton renders a native button (or, with asChild, your link with the same look). Give icon-only buttons an aria-label.loading it sets aria-busy and aria-disabled; clicks are ignored and a link does not navigate.aria-hidden. The label is HTML above the drawing and is never deformed.--primary when it has color, else --brand, at a fixed lightness per theme (light L 0.48, dark L 0.68). The ink is chosen from the fill (white or near black) and stays at least 4.5:1; hover and press move the fill away from the ink, so contrast only grows. The rim is at least 1.5:1 on the fill and the flat shadow is foreground at 26% (light) or 30% (dark).| Key | Action |
|---|---|
| Enter / Space | Presses the button: the surface contracts and widens while held, then springs back with a wobble |
| Tab | Focus: the ring follows the outline and a small bump rises at the bottom |
No tongue, squash or wobble: a still pill on its flat shadow. Hover changes the tone in 150 ms, press darkens it and loading shows a dashed rim instead of the travelling arc. The focus ring, the shadow and every state stay visible.
requestAnimationFrame loop rebuilds one small SVG path: it runs only while the pointer is within reach, the button is pressed, focused, loading, or something is still settling, and stops at rest. Declared exception to transform-only: the d attribute of that path changes, because no transform can draw the tongue.useShouldAnimate); the button then shows its rest shape.ResizeObserver, never per frame. Pointer tracking uses one passive pointermove listener on window.Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Not measured yet · budget 15.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, @radix-ui/react-slot.
pointer movement, press, keyboard focus, a loading state
No tongue, squash or wobble: a still pill on its flat shadow; hover changes the tone in 150 ms, press darkens it, loading shows a dashed rim.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)