FAB: Floating Action Button

July 22, 2021 ยท View on GitHub

A circular main button with a Shadow and Ripple effect.

Differences from a Raised Button behavior:

  • The ripple emanates from the center of the button
  • The ripple has a 2/3 decay speed
  • No selected state

Main features

  • All Button main features
  • Custom icon
  • Display mini size

Usage

Options

Button options

See:

FAB specific options

ParameterRequiredTypeDefaultDescription
iconuse icon or contentObjectIcon options object
minioptionalBooleanfalseSet to true to display a small button (class name pe-fab--mini)

Common component options

ParameterRequiredTypeDefaultDescription
afteroptionalString, hyperscript or componentExtra content after main content; note that this content is placed right of preceding elements with a higher stacking depth
beforeoptionalString, hyperscript or componentExtra content before main content; note that this content is placed left of subsequent elements with a lower stacking depth
classNameoptionalStringExtra CSS class appended to pe-fab
contenteither icon or contentString, hyperscript or componentAlternative content
elementoptionalString"div"HTML element tag
eventsoptionalObjectOptions object containing one or more standard events such as onclick (React: onClick)
idoptionalStringHTML element id
styleoptionalObjectFor setting simple style attributes
tabindex (React: tabIndex)optionalIntegerTab index
toneoptionalString: "dark" or "light"Renders the component light on dark (sets class pe-dark-tone); use "light" to locally inverse (sets class pe-light-tone)

Composition

FAB is composed from:

CSS classes

Future

"The floating action button animates onto the screen as an expanding piece of material, by default. The icon within it may be animated."

"The floating action button can transform into a toolbar upon press or scroll. The toolbar can contain related actions, text and search fields, or any other items that would be useful at hand."

"The floating action button can fling out related actions upon press."

"The floating action button can transform into a single piece of material which contains all the actions."

"The floating action button can transform into sheets of material that are part of the app structure."