FAB menu
ExpressiveA FAB that opens two to six related actions above it, or a menu on the web.
import { FabMenu, FabMenuItem } from '@windmorph/react';Purpose
A FAB menu is a FAB that opens two to six closely related actions above it. Use it when one surface needs a few primary actions rather than a single one, but not beside a floating toolbar or navigation rail. The button shrinks into a 56px close button while the items (FabMenuItem, given directly as children) appear one after another. Every item has a label; keep its icon unless you really must drop it, since icons tell the items apart.
Anchor the menu to the window's trailing edge with className: 16px margins (fixed end-4 bottom-4), rising to 24px in large and extra-large windows (large:end-6 large:bottom-6). The items open upwards and line up on the trailing edge, which mirrors in RTL. On short windows they scroll behind the close button, which stays reachable.
Keep the menu out of normal flow: fixed, or at the bottom of a box (absolute end-4 bottom-4 in a relative one, or items-end in a fixed-height flex box). In normal flow the open list takes up room, so it pushes the button down and can scroll the page as it opens and closes.
On the web, M3 has the FAB open a standard menu: use presentation="menu" on large screens (the expanded window class, 840px and up), and keep the default list in compact and medium windows, choosing it per window size class. Items run onAction (or follow href) in either presentation. visible and appear work as on Fab.
When not to use
For a single action use a plain FAB; for a long list of choices use a Menu.
See also
- FAB menu on m3.material.io: Material's own guidelines, with anatomy and specs.
- FAB: A screen's single most important action, as an icon or an extended label.
- Menu: A temporary list of choices anchored to a trigger, with groups, selection, submenus and context menus, or a bottom sheet on phones.
- Toolbars: Docked and floating toolbars of related actions, with an optional FAB, scroll collapse and scroll exit.