A floating action button (FAB) is a fixed-position button that surfaces the most important action on a screen. These 16 hand-coded designs are ready-to-ship FABs for chat windows, compose actions, scroll-to-top, and quick-add controls — copy the markup, wire your handler, and ship.
The benchmark FAB — a solid gradient circle with a + icon that lifts on hover with a deepening shadow. The pattern every Material design system reaches for first.
Hover or focus reveals 3 child actions arcing upward — the classic FAB speed-dial. Keyboard accessible because focus stays within the group via :focus-within.
A continuous concentric pulse ring radiates outward — the attention-getter pattern for "new feature" or "tap me" prompts. Pure CSS via box-shadow keyframes.
The circle morphs into a search input on hover — width and border-radius animate together, the icon sliding to the left edge. Premium micro-interaction.
Pill-shape with icon + text label ("+ New project") — wider than a circle, more discoverable for first-time users. Common pattern in modern dashboards.
Click triggers a loading state — the icon swaps for a spinner, button is disabled, returns to ready after 1.5s. Demonstrates the async-action FAB pattern.
Click expands into 4 emoji reactions — the messaging-app reaction picker pattern. Uses :focus-within for keyboard accessibility (focus a reaction without it disappearing).
A floating action button is a circular or pill-shaped button positioned above the page content (usually pinned to the bottom-right) that surfaces the single most important action on the current screen. The pattern was popularised by Google's Material Design and is now used across Android, iOS, web apps and dashboards.
When should I use a FAB on my site?
Use a FAB when there's exactly one primary action a user is most likely to take — Compose in an email app, New post in a social feed, Add task in a to-do app. Don't use one when there are multiple equally-important actions; an inline button bar is better for those cases.
Can these floating action buttons be used in any framework?
Yes. Every demo is plain HTML + CSS (a few add ~30 lines of vanilla JS for state). Drop the markup into any React, Vue, Svelte, Astro or static HTML page — no dependencies, no build step, MIT licensed.
Are the FAB designs accessible and mobile-friendly?
Yes. Every demo uses a real <button> element with a descriptive aria-label, visible focus states, sufficient colour contrast, and a 44×44px minimum tap target. Continuous animations (pulse, aurora, badge ping) honour the prefers-reduced-motion media query.
Do I need JavaScript to use these floating buttons?
Most don't — 14 of the 16 are pure CSS using :hover, :focus and :checked-driven state machines. Only the Loading Spinner and Voice Action demos include JS, and each ships with a self-contained snippet under 30 lines that you can copy alongside the HTML and CSS.