UI Micro-interactions
Tooltip Pop
Heart icon button springs a mint-green tooltip above it on hover with a cubic-bezier spring pop; click triggers a subtle press-bounce via Web Animations API.
csslight complexitysubtle motionhover
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
Worth keeping?
Votes steer what gets built next — sign in to cast one, free to read
When to use it
Icon-only buttons needing a label reveal, favorites or bookmark actions, any UI where a tooltip clarifies an ambiguous control.
When not to
Touch-only interfaces where hover is unavailable; layouts where there is no room above the button for the tooltip to appear.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change tooltip text to 'Save for later', update accent color from #4fe0c0 to #a78bfa, and slow the spring transition to 0.36s. Theme: dark tokens live in :root, the light variant in :root[data-theme="light"]; ?theme=light or a {type:'forever:theme'} postMessage switches at runtime.
Safe to edit
- tooltip label text (#tip inner text)
- accent color (#4fe0c0)
- spring easing (cubic-bezier(.2,1.5,.4,1))
- tooltip offset (bottom: calc(100% + 14px))
- idle demo cadence (first pop after 400 ms, then alternates every 1700 ms)
- button size (54px)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- reduced-motion guard (reduce var)
- visibilitychange pause (clearInterval)
- IIFE wrapper
- pointerenter/pointerleave listeners
- hover takeover (hover flag: the demo never toggles under a real pointer)
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Idle demo cycle runs by default (real input takes over, resumes after a few idle seconds) — remove the demo block for purely on-demand interaction
- Tooltip position is hardcoded above the button; may clip at top of viewport
- Button div lacks aria role and aria-label — add for production accessibility
More UI Micro-interactions components
- Add to Cart FlyProduct tile flings a mini clone in a bezier arc into a cart icon on click; badge count bumps with a spring bounce. Auto-cycles as demo.
- Notification BellSVG bell swings and rings with a ripple wave on click; a red badge counter pops in with a springy bounce and increments each ring. Auto-cycles every 2…
- Copy ConfirmCopy icon morphs to a drawn-stroke checkmark with a green button flash and a "Copied!" toast on click; auto-cycles as a demo loop.
- Swipe Card StackTinder-style draggable card stack — drag the top card left/right to reveal NOPE/LIKE stamps; fling-away animates it off-screen and cycles to the next card.
- Pull to RefreshA phone-frame mockup with draggable list rows; pulling down reveals a teal arc spinner that fills and rotates, then triggers a skeleton-row flash on release.
- Accordion ExpandThree FAQ panels smoothly expand and collapse with a CSS height transition; a chevron rotates 180 degrees to indicate open state. Auto-cycles as demo.