MD3
Expressive
MATERIAL DESIGN 3 EXPRESSIVE

Extended Floating Action Button (Extended FAB)

Extended floating action buttons help people take primary actions on wide layouts or long scrollable views, using both an icon and text label for clarity.

Extended floating action buttons (Extended FABs) are more prominent than regular FABs. They feature both a text label and an icon to clarify the action. They can transform/collapse into standard FABs (icon-only) on scroll.

Introduction

Material Design 3 Expressive Extended FABs are perfect for screens with long, scrolling views that require persistent access to a primary action (e.g., checkout, publish post). They feature high-fidelity spring motion, shape-morphing physics on tap, and native support for internationalization (RTL). Unlike baseline Extended FABs, the modern Expressive spec replaces the deprecated baseline with the Small (56dp) variant utilizing Title Medium typography.

Anatomy

  • Container: A rounded rectangular surface that wraps the inner layout. Hugs content dynamically by default.
  • Icon (Optional): Intuitively represents the action. Replaced automatically with a spinner when loading.
  • Label Text (Required): Describes the action clearly. Recommended to be 1–2 words at most. Avoids wrapping or truncation.
  • State Layer: Shows interactive feedback overlay (hover, focus, pressed) using MD3 expressive ripples.

Variants

Sizes

The M3 Expressive specification defines three variants of Extended FABs:

  • Small (56dp): Height 56dp. Replaces the deprecated baseline layout. Title Medium font size.
  • Medium (80dp): Height 80dp. Title Large font size.
  • Large (96dp): Height 96dp. Maximum prominence on spatial UIs or compact screen layouts. Headline Small font size.
Loading demo...

Color Styles & Customizations

Extended FABs can map to three primary color container tokens: Primary, Secondary, and Tertiary. You can also utilize the lowered prop to reduce resting elevation when nesting inside app bars, or omit the icon completely for label-only FABs.

Loading demo...

Features

Scroll Collapse & Controlled Mode

The Extended FAB can collapse into an icon-only pill-shaped FAB when scrolling down to temporarily occupy less screen space, and expand again when scrolling up. You can toggle this auto behavior via collapseOnScroll or manually control the state from outside via the collapsed prop.

Loading demo...

Right-to-Left (RTL) Support

In right-to-left layout orientations (e.g. Arabic, Hebrew), Extended FABs automatically mirror their layout, positioning the icon to the right of the label text.

Container Transform (Morphing)

Using the newly added layoutId prop along with Framer Motion's Layout Projection, the Extended FAB can morph seamlessly into another surface (like a compose dialog, card, or panel).

Loading demo...

Usage

Basic Usage

import { ExtendedFAB, Icon } from "@bug-on/m3-expressive";

<ExtendedFAB 
  label="Compose"
  icon={<Icon name="edit" />} 
  onClick={() => console.log("Click!")} 
/>

Auto Collapse on Scroll

import { ExtendedFAB, Icon } from "@bug-on/m3-expressive";

// Automatically collapses when scroll down passes 50px threshold
<ExtendedFAB 
  label="Compose"
  icon={<Icon name="edit" />} 
  collapseOnScroll
  scrollThreshold={50}
/>

Best Practices

Do

  • Use only one Extended FAB per screen to maintain a clean visual hierarchy.
  • Keep the label text to 1-2 words at most to prevent overcrowding.
  • Place the Extended FAB above content panels or in consistent navigation rails.

Next.js Integration (asChild)

Use asChild to wrap Next.js Link with Extended FAB styling and collapse behavior.

import Link from "next/link";
import { ExtendedFAB, Icon } from "@bug-on/m3-expressive";

<ExtendedFAB asChild label="Compose" icon={<Icon name="edit" />}>
  <Link href="/compose">Compose</Link>
</ExtendedFAB>

Don't

  • Don't use multiple Extended FABs on a single screen.
  • Don't use baseline configurations (surface color, large-baseline button size) which are deprecated.
  • Don't let the text label wrap into multiple lines.

Design Tokens

Measurements & Layout

SizeContainer HeightShape Radius (default)Shape Radius (collapsed)Icon SizeTypography
Small56dp (h-14)16px28px (pill)24dpTitle Medium
Medium80dp (h-20)20px40px (pill)28dpTitle Large
Large96dp (h-24)28px48px (pill)36dpHeadline Small

Color Mapping

Token RoleTailwind BgTailwind Text
Primarybg-m3-primary-containertext-m3-on-primary-container
Secondarybg-m3-secondary-containertext-m3-on-secondary-container
Tertiarybg-m3-tertiary-containertext-m3-on-tertiary-container

Accessibility

  • ARIA Accessible Name: The aria-label automatically defaults to the required label prop. When collapsed, the aria-label remains present for screen readers.
  • Interactive States: Keyboard navigation is fully supported out of the box (Tab focus, interaction via Enter or Space keys).
  • Reduced Motion: Entrance, exit, and collapse width transitions respect standard systems' prefers-reduced-motion configurations.

API Reference

ExtendedFAB

PropTypeDefaultDescription
labelstringRequired. The text label to display.
iconReactNodeThe icon to display next to the label (optional).
size"sm" | "md" | "lg""sm"The size of the Extended FAB according to the Expressive spec.
colorStyle"primary" | "secondary" | "tertiary""primary"The background color container role.
loweredbooleanfalseReduces the resting elevation (shadow) of the FAB to shadow-sm.
loadingbooleanfalseDisplays a loading state and disables interaction.
loadingVariant"loading-indicator" | "circular""loading-indicator"The type of loading spinner to display.
visiblebooleantrueControls the visibility of the FAB with a scale transition.
collapseOnScrollbooleanfalseAutomatically collapses into an icon-only FAB when scrolling down.
scrollThresholdnumber50The minimum scroll threshold (in px) to trigger collapse.
collapsedbooleanManually controls the collapsed state from the outside.
onCollapsedChange(collapsed: boolean) => voidCallback triggered when the collapsed state changes.
asChildbooleanfalseRenders as the child element while keeping styles.
layoutIdstringUnique identifier for Container Transform (seamless surface morphing).