Buttons & Toggles
Morphing Action FAB
Gradient FAB whose plus icon rotates 135° to an X on click, fanning six icon buttons outward in a staggered radial spring animation. Auto-cycles in demo mode.
cssmedium complexitymoderate motionclick
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
Mobile-style action menus, dashboard toolbars, or any context needing quick access to 4–6 secondary actions from a single trigger button.
When not to
Layouts where the FAB overlaps critical content. Remove the auto-cycle loop before shipping in production — it fires every ~2.6 s regardless of user intent.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change the gradient from marigold-tan to amber-rose by updating --grad-iris-cyan to linear-gradient(120deg,#f97316,#e11d48), and increase the radial spread radius from 64px/55px to 80px/68px. 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
- gradient color (--grad-iris-cyan)
- radial spread distances (64px / 55px in nth-child transforms)
- stagger delay per item (0ms..250ms)
- item count (add/remove .c03-fab__item buttons)
- FAB size (60px main / 42px items)
- idle demo cadence (OPEN_MS=1800 open / CLOSED_MS=1600 closed, first open after 500 ms)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- IIFE wrapper
- prefers-reduced-motion guard (reduce var + transition-duration override)
- visibilitychange stop/loop pattern
- aria-expanded + tabindex management in setOpen()
- idle demo cycle driving setOpen() + takeover on real pointer/key input
- 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
- Six items at 64px/55px spread; adding more items requires manually computing new translate() positions
- tabindex='-1' on items means keyboard nav is absent when closed — Escape closes but Arrow keys not wired
More Buttons & Toggles components
- Magnetic ButtonDark pill button drifts in an idle orbital float; cursor proximity pulls it magnetically with a label inner-parallax and emerald-to-copper glow on hover.
- Gooey Liquid TogglePill toggle where an SVG goo-filtered blob stretches and merges as it slides from off to on, shifting grey to magenta. Auto-cycles as demo.
- Material RippleDark rounded button that spawns an expanding ink ripple from the tap point; idles by firing ripples from random positions every 1.5 s.
- Neon Glow PulseAmber pill button on near-black that breathes a bright neon bloom via opacity pulse on a pseudo-element; hover shifts background and text color.
- Jelly PressAurora-gradient button squashes and stretches with a spring keyframe animation on click; auto-cycles idle squish every 2.1s to stay alive at rest.
- Stroke-Draw OutlineGhost button whose rounded-rect SVG border self-draws via stroke-dashoffset on hover; an idle loop auto-cycles draw/erase every ~2s.