Fab

The Fab component provides a reusable pattern for fab in the interface.

FAB

Note: We've removed the placement of the buttons to prevent issues with documentation. Remove the values from the classList to get the intended layout.

Multi FAB

Multiple FABs can be used together, but they should be used with caution to avoid overwhelming the user. When using multiple FABs, it's important to ensure that each button has a clear and distinct purpose, and that they are visually differentiated from each other. Additionally, it's important to consider the placement of the buttons to ensure that they are easily accessible and do not interfere with other elements on the screen.

Vestibulum id ligula porta felis euismod semper

Hello! I'm home!

Vestibulum id ligula porta felis euismod semper

Hello I'am a FAB!

FAB width small

Demonstrates the c-fab--width-sm modifier, which decreases the panel width by reducing the size multiplier.

Small width modifier

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.

FAB width large

Demonstrates the c-fab--width-lg modifier, which increases the panel width by increasing the size multiplier.

Large width modifier

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.

FAB width x-large

Demonstrates the c-fab--width-xl modifier, which significantly increases the panel width by increasing the size multiplier.

x-Large width modifier

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.

FAB with overflowing content

Demonstrates long panel content that exceeds the viewport height, so the panel scrolls within its max-height.

Long content overflow

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.

Curabitur blandit tempus porttitor. Cras mattis consectetur purus sit amet fermentum. Donec sed odio dui.

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Maecenas sed diam eget risus varius blandit.

Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.

Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Donec ullamcorper nulla non metus auctor fringilla.

Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Etiam porta sem malesuada magna mollis euismod.

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Sed posuere consectetur est at lobortis.

Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean lacinia bibendum nulla sed consectetur.

Donec sed odio dui. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa.

Maecenas faucibus mollis interdum. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.

API

Parameter Default Description
bottom-right Where on the screen the FAB should be positioned
false Heading text for panel
false Settings for the button element (trigger)
Contents of popup panel
false The label to indicate closing action
false The icon to indicate closing action

CSS API

Variable Default Type Values Description
var(--base) range - Main unit that drives radius and spacing scales.
var(--border-radius) range - Border Radius
var(--color--surface) color - Surface
var(--space) range - Base spacing unit. Used for padding and margin inside components.
var(--border-width) range - Size
var(--color--surface-border) color - Manual companion token for borders on surface elements.
var(--corner-shape) select square, round, squircle, circular, bevel, scoop Corner Shape
var(--shadow-color) rgba - Shadow Color
var(--shadow-amount) range - Multiplier for elevation shadows. 0 = none, 1 = default.
var(--font-size-400) range - Three steps above base in the type scale. Equivalent to h4.

Similar components