Floating action
One round accent button that floats over the content of a phone screen for the action people come to that screen to do (new message, add expense). It is the only resting control that casts a shadow.
Usage
Use it when
- A phone screen whose main purpose is creating something in the list it shows: compose a message, log an expense, add a note.
- The list scrolls long enough that a button at its top or bottom would often be out of reach.
Use something else when
- Wide screens and desktop layouts: use Button. Put a
btn--primaryin the page header instead; a floating disc in the corner of a 1400 px window is easy to miss. - The screen has a primary action at the end of a form or flow: use Button. Use a full-width
btn--primary btn--blockin a sticky bar. - Two or more equally important actions: use Button group.
- Actions that apply to selected items: use Selection bar.
- A small icon action in a toolbar or card: use Icon button.
Where it goes. Bottom right of a phone screen, 16 to 20 px from the edges, above the tab bar (bottom = tab bar height + 16) and above the home indicator (env(safe-area-inset-bottom)). One per screen. It must not cover the last row: give the scrolling list bottom padding of at least the button height plus 32.
Examples
Messages
<button class="icon-btn icon-btn--accent" aria-label="New message" style="position: fixed; right: 20px; bottom: calc(83px + 16px); width: 56px; height: 56px; box-shadow: var(--finish-primary), var(--shadow-md);"> <span class="ic" aria-hidden="true">edit</span> </button>
Anatomy
| Part | What it is |
|---|---|
.icon-btn.icon-btn--accent | Required. Accent fill, white glyph, primary finish. |
aria-label | Required. The action ("New message"). |
style | Size and placement are not in the system yet: set width: 56px; height: 56px and position: absolute (or fixed) with right and bottom, plus box-shadow: var(--finish-primary), var(--shadow-md). |
States
| State | How |
|---|---|
hover | --accent-hover on devices that can hover. |
:active | Sinks to scale(0.9) in 90 ms, back on --spring-snappy. |
hidden while scrolling | Optional: hide on scroll down, show on scroll up. Not built in; if you add it, slide it 24 px down with an opacity fade on --ease-exit over --d-exit, and back on --spring-smooth. |
Motion and microinteractions
- Press:
scale(0.9)with a 90 ms transition, release on--spring-snappyover--d-snappy, like every icon button. - What it opens should grow from it: a sheet rising from the bottom on
--spring-smooth, never a dialog popping in the middle. - It does not pulse, bounce or rotate at rest. Under reduced motion only the press remains (as a 120 ms change).
Accessibility
- A real
<button>witharia-label; the glyph isaria-hidden. - Place it in the DOM after the main content (or at the end of the screen region) so Tab reaches it after the list, matching where it sits.
- It must not hide content: keep bottom padding under the list so the last row can scroll above it.
- White on
--accentholds 5.2:1 in both themes.
Do and don't
Do
- Use one per screen, for the most frequent creation action.
- Clear the tab bar and the home indicator.
- Open a sheet from it on phones.
Don't
- Use it on desktop layouts or inside cards.
- Add a speed-dial of several floating buttons.
- Give any other resting control a shadow to look like it.