Nudge Button
A white pill CTA with a directional nudge interaction — concentric blue, red, and yellow rings burst from the exact pointer entry point before a white reveal pushes them out through the clipped edges. One component scales from gallery card to fullscreen.
Installation#
pnpm dlx shadcn@latest add @davinciui/nudge-buttonUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
childrenCentered label. Never moved, resized, or distorted by the rings. | React.ReactNode | "BUY NUDGE" |
colorsRing palette from outermost to the reveal layer. Reveal should match the button surface for a seamless exit. | { outer?: string; middle?: string; inner?: string; reveal?: string } | blue / red / gold / white |
durationTotal interaction length in milliseconds. Relative layer stagger is preserved at any value. | number | 850 |
disabledDisables the interaction and the click. | boolean | false |
onClickClick handler. Never interfered with by the ring animation. | (event) => void | — |
Accessibility#
A native button keeps Enter and Space activation; keyboard focus triggers the ring burst from center while pointer use uses the entry point. Decorative rings are aria-hidden and focus-visible draws a 2px outline.
Motion#
Four aria-hidden rings scale outward with staggered delays on hover, press, or keyboard focus, and duration scales the 850ms base timeline. matchMedia detects prefers-reduced-motion and replaces rings with a 220ms background tint.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

