Skip to content
Kimenpre-v1documentation home
Color scheme

ki-fab-menu

Use a FAB menu when one screen has two to six related actions, such as creating a message or scheduling an event.

Theme for this example
Color scheme for this example
New message New event
<div style="display:grid;align-items:end;justify-items:end;min-block-size:12rem">
<ki-fab-menu label="Create" scrim="false">
<ki-fab-menu-item value="message">New message</ki-fab-menu-item>
<ki-fab-menu-item href="#event">New event</ki-fab-menu-item>
</ki-fab-menu>
</div>

Give each item a visible label. Set its value to a stable command identifier when your application handles ki-select. Without a value, the event reports the trimmed item label. Items with href navigate as native links.

Enter, Space and ArrowDown open the menu at the first action. ArrowUp opens it at the last action. Up and Down wrap, Home and End go to the first and last actions, and Escape returns focus to the trigger. Tab continues through the page’s focus order. Use close-label to localize the close button’s name.

Static menus need space above the trigger. For fixed placement, reserve clearance for the FAB after your content and set --ki-fab-mobile-nav-block-size when fixed navigation uses the same corner. Use scrim="false" for an embedded example or to keep the background undimmed.

When to use: group related creation or screen actions behind one floating button.

When not to use: for a single primary action, long lists, or site navigation.

Properties & attributes

AttributePropertyTypeDefaultDescription
close-labelcloseLabelstring'Close menu'Localized accessible name of the trigger when it becomes the close control.
icon-nameiconNamestring'plus'Registered Lucide glyph for the closed trigger. The plus glyph ships with the component.
labellabelstring–Accessible name of the closed trigger and of the menu.
openopenbooleanfalseWhether the action stack is open. Reflected when the user opens or dismisses it.
positionposition"fixed" | "static"'static'Static anchors to the host. Fixed anchors to the viewport's block-end inline-end corner.
scrimscrimbooleantrueDim the viewport and dismiss on a scrim click. Use the boolean property or scrim="false" to opt out.
variantvariant"primary" | "secondary" | "surface"'secondary'Closed FAB surface. The open trigger always uses primary.

Events

EventDetail typeDescription
ki-closeCustomEvent<void>Emitted when the action stack closes.
ki-openCustomEvent<void>Emitted when the action stack opens.
ki-selectCustomEvent<KiFabMenuSelectDetail>Emits the selected item's value or its trimmed label. Native links retain their destination.

Slots

SlotDescription
(default)Two to six direct ki-fab-menu-item children, in top-to-bottom order.

CSS parts

PartDescription
menuThe named action list above the trigger.
scrimThe optional pointer-dismissible overlay behind the menu.
triggerThe native floating button that opens and closes the menu.

CSS custom properties

The public styling contract of ki-fab-menu: reassign these tokens at :root or on a subtree — never override internals.

TokenDescription
--ki-density-target-minThe smallest pointer target any density may produce: 24 x 24 CSS px by default and in compact (WCAG 2.5.8 AA), 44 x 44 in touch (WCAG 2.5.5). It floors a shrinking control but never lifts what a control paints: a control painted smaller extends its target to it, invisibly; rows and tabs grow to it (spec 045 A1).
--ki-fab-backdrop-filterComplete optional filter behind the FAB.
--ki-fab-bgTinted secondary FAB fill.
--ki-fab-bg-imageOptional layer painted over the FAB fill.
--ki-fab-fgInk on the tinted secondary FAB.
--ki-fab-font-familyTypeface for FAB labels.
--ki-fab-forced-colors-border-widthBoundary width for the FAB in forced colors.
--ki-fab-hover-shadowFAB elevation for a pointer that can hover.
--ki-fab-icon-sizeGlyph size of the default FAB.
--ki-fab-menu-gapGap between two stacked actions.
--ki-fab-menu-scrim-backdrop-filterComplete optional filter behind the scrim.
--ki-fab-menu-scrim-bgDimming fill behind the open menu and its trigger.
--ki-fab-menu-scrim-bg-imageOptional image painted above the scrim fill.
--ki-fab-menu-trigger-gapGap between the last action and the FAB.
--ki-fab-mobile-nav-block-sizeHeight to reserve for mobile navigation, excluding the safe-area inset.
--ki-fab-offsetFixed FAB gap to the viewport edge or mobile navigation.
--ki-fab-primary-bgStrong primary FAB fill.
--ki-fab-primary-fgInk on the strong primary FAB.
--ki-fab-radiusCorner radius of the default FAB size.
--ki-fab-shadowResting FAB elevation.
--ki-fab-sizeMinimum FAB footprint in the default size.
--ki-fab-surface-bgRaised surface FAB fill.
--ki-fab-surface-fgInk on the raised surface FAB.
--ki-focus-ring-colorColour of the keyboard focus ring every focusable component draws: 3:1 or more against the page in every theme and scheme.
--ki-focus-ring-offsetGap between a focusable component and its keyboard focus ring.
--ki-focus-ring-widthThickness of the keyboard focus ring every focusable component draws (its outline). One token instead of one per component, so a mode or a theme changes every ring at once.

When to use: as a direct child of ki-fab-menu, with a short, visible action label.

When not to use: for a standalone action, a form control, or a container of interactive content.

Properties & attributes

AttributePropertyTypeDefaultDescription
hrefhrefstring | undefined–A nonempty destination renders a native link and preserves relative URL resolution.
icon-nameiconNamestring | undefined–Registered Lucide glyph. Import the desired icon before rendering.
valuevaluestring | undefined–Stable selection identifier. When omitted, the menu reports the trimmed visible label.

Events

EventDetail typeDescription
ki-selectCustomEvent<KiFabMenuSelectDetail>Local command selection for a direct action binding. Links use native navigation.

Slots

SlotDescription
(default)The visible action label.

CSS parts

PartDescription
controlThe native action button or link.
iconThe decorative glyph next to the label.

CSS custom properties

The public styling contract of ki-fab-menu-item: reassign these tokens at :root or on a subtree — never override internals.

TokenDescription
--ki-density-target-minThe smallest pointer target any density may produce: 24 x 24 CSS px by default and in compact (WCAG 2.5.8 AA), 44 x 44 in touch (WCAG 2.5.5). It floors a shrinking control but never lifts what a control paints: a control painted smaller extends its target to it, invisibly; rows and tabs grow to it (spec 045 A1).
--ki-fab-forced-colors-border-widthBoundary width for the FAB in forced colors.
--ki-fab-menu-item-backdrop-filterComplete optional filter behind the action.
--ki-fab-menu-item-bgTinted surface of a floating action.
--ki-fab-menu-item-bg-imageOptional image painted above the action fill.
--ki-fab-menu-item-content-gapSpace between the action glyph and label.
--ki-fab-menu-item-fgLabel and icon ink on the tinted action surface.
--ki-fab-menu-item-font-familyTypeface for action labels.
--ki-fab-menu-item-font-sizeText size for action labels.
--ki-fab-menu-item-font-weightText weight of an action label.
--ki-fab-menu-item-heightMinimum block size and inline target of an action.
--ki-fab-menu-item-hover-shadowElevation of a hovered action.
--ki-fab-menu-item-icon-sizeSize of the glyph preceding an action label.
--ki-fab-menu-item-line-heightLine height of an action label.
--ki-fab-menu-item-padding-blockBlock padding for a wrapping action label.
--ki-fab-menu-item-padding-endInline-end padding of an action.
--ki-fab-menu-item-padding-startInline-start padding of an action.
--ki-fab-menu-item-radiusPill radius of an action.
--ki-fab-menu-item-shadowElevation of a resting action.
--ki-focus-ring-colorColour of the keyboard focus ring every focusable component draws: 3:1 or more against the page in every theme and scheme.
--ki-focus-ring-offsetGap between a focusable component and its keyboard focus ring.
--ki-focus-ring-widthThickness of the keyboard focus ring every focusable component draws (its outline). One token instead of one per component, so a mode or a theme changes every ring at once.