Skip to main content

nav-fab

shadow

Fabs are container elements that contain one or more fab buttons. They should be placed in a fixed position that does not scroll with the content. Fabs should have one main fab button. Fabs can also contain one or more fab lists which contain related buttons that show when the main fab button is clicked.

Basic Usage

List Side

The side property of the fab list component controls where it appears relative to the main fab button. A single fab can have multiple fab lists as long as they all have different values for side.

Positioning

In order to place the fab in a fixed position, it should be assigned to the fixed slot of the outer content component. Use the vertical and horizontal props to control the alignment of the fab in the viewport. The edge prop will cause the fab button to overlap with the app's header or footer.

Button Sizing

Setting the size property of the main fab button to "small" will render it at a mini size. Note that this property will not have an effect when used with the inner fab buttons.

Theming

Colors

CSS Custom Properties

CSS Shadow Parts

Accessibility

Labels

Since FABs are allowed to contain only icons, developers must provide an aria-label on each nav-fab-button instance. Without this label, assistive technologies will not be able to announce the purpose of each button.

Properties

activated

DescriptionIf true, both the nav-fab-button and all nav-fab-list inside nav-fab will become active. That means nav-fab-button will become a close icon and nav-fab-list will become visible.
Attributeactivated
Typeboolean
Defaultfalse

edge

DescriptionIf true, the fab will display on the edge of the header if vertical is "top", and on the edge of the footer if it is "bottom". Should be used with a fixed slot.
Attributeedge
Typeboolean
Defaultfalse

horizontal

DescriptionWhere to align the fab horizontally in the viewport.
Attributehorizontal
Type"center" ๏ฝœ "end" ๏ฝœ "start" ๏ฝœ undefined
Defaultundefined

vertical

DescriptionWhere to align the fab vertically in the viewport.
Attributevertical
Type"bottom" ๏ฝœ "center" ๏ฝœ "top" ๏ฝœ undefined
Defaultundefined

Events

No events available for this component.

Methods

close

DescriptionClose an active FAB list container.
Signatureclose() => Promise<void>

CSS Shadow Parts

No CSS shadow parts available for this component.

CSS Custom Properties

No CSS custom properties available for this component.

Slots

No slots available for this component.