• Light
  • Dark
  • Darkest
  • Medium
  • Large
  • LTR
  • RTL
  • Default
  • Express

Floating action button

Component status
Contribution
Current version@spectrum-css/floatingactionbutton@2.1.2
ReleasedAugust 29, 2024
S2-foundations@spectrum-css/floatingactionbutton@3.0.0-s2-foundations.11
ReleasedAugust 2, 2024

Usage notes


  • Floating action button is used to give users a more prominent button for high frequency actions
  • When using Floating Action Button in dark themes, the background-layer-color-2 will often show up on the base color gray-50 or gray-75 or on content, images, etc.

Variants


Primary
Contribution

Show markup
<button class="spectrum-FloatingActionButton spectrum-FloatingActionButton--primary" aria-label="Add">
  <svg class="spectrum-Icon spectrum-FloatingActionButton-icon" focusable="false" aria-hidden="true">
    <use xlink:href="#spectrum-icon-18-AddCircle" />
  </svg>
</button>

Secondary
Contribution

Show markup
<button class="spectrum-FloatingActionButton spectrum-FloatingActionButton--secondary" aria-label="Add">
  <svg class="spectrum-Icon spectrum-FloatingActionButton-icon" focusable="false" aria-hidden="true">
    <use xlink:href="#spectrum-icon-18-AddCircle" />
  </svg>
</button>

Custom Properties API


This component can be modified via its --mod-* prefixed custom properties. A list of those prefixed custom properties can be found here.