Recipes
Floating Action Button
The floating action button as a floating Button - circular, elevated and positioned by CSS in the viewport or the nearest positioned parent, in nine logical positions.
<Button floating> is the floating action button: circular,
elevated, position: fixed, with no JavaScript positioning. Its shape is
fixed by the system.
<Button floating iconOnly aria-label="Compose" iconStart={<PencilIcon />} />
floatingistrue('bottomEnd') or one of'topStart','topCenter','topEnd','middleStart','middleCenter','middleEnd','bottomStart','bottomCenter','bottomEnd'. The positions are logical:Endis the right edge in LTR and the left edge in RTL.floatingScope="parent"usesposition: absoluteinside the nearest positioned ancestor; the default is'viewport'.- A floating button defaults to
tone="primary";toneandvariantapply as on any button. - Hide it with the native
hiddenattribute or conditional rendering; move it withclassNameorstylelogical insets such asinsetBlockEnd. - Icon-only FABs need a name like any icon-only button; an icon plus text
uses
childrenwithiconStart. Enter / Space activate and Tab moves focus natively.repeat, toggling and the other Button members apply unchanged.
Floating action button
Open demoFloating buttons positioned by CSS inside a panel, with pickers for the nine logical positions, tone and variant, a visibility toggle, custom insets and a press-and-hold floating button.
Drafts: · Zoom:
Positioning
No method is needed to refresh the position: CSS positioning follows layout changes on its own.