Speed Dial

Material Design 3-styled speed dial web components (lit-material-speed-dial, lit-material-speed-dial-action): an expandable FAB menu.

  • 3.3 KB gzipped
  • @lit-material/speed-dial 0.1.0
  • Renders on the server

Example

Install

npm install @lit-material/speed-dial @lit-material/tokens
import "@lit-material/speed-dial";

Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide

API

<lit-material-speed-dial-action>

A single action within a lit-material-speed-dial — a small (mini-FAB sized) icon button with an optional visible label. Purely presentational: it has no click handler of its own (a native disabled button already never fires click at all) — the parent speed dial listens for the bubbling click (the same event.composedPath() delegation lit-material-select and lit-material-menu use) to close itself, the same way lit-material-menu closes on an item click without that item needing to know it's inside a menu at all.

Properties

PropertyAttributeTypeDefaultDescription
disableddisabledbooleanfalse
labellabelstring""The visible pill's fallback text and the button's accessible name — see the class doc.

Slots

SlotDescription
iconThe action's icon.
labelOptional visible label, shown as a pill beside the icon.

CSS parts

PartDescription
actionThe icon button.
labelThe label pill.
rippleThe state-layer element the hover/press feedback is drawn on.
focus-ringThe focus indicator element.

<lit-material-speed-dial>

A FAB that expands into a column of lit-material-speed-dial-action items — built on the native Popover API for the actions list (top-layer rendering, light dismiss on outside click/Escape all come from the browser), the same foundation lit-material-menu uses.

Properties

PropertyAttributeTypeDefaultDescription
openopenbooleanfalse
directiondirectionSpeedDialDirection"up"
disableddisabledbooleanfalse
labellabelstring"Actions"The trigger's accessible name — required, since it's an icon-only button.

Events

EventDescription
closeFires after the speed dial closes, for any reason (an action's activation, close(), Escape, or an outside click).

Slots

SlotDescription
iconThe trigger's icon (rotates 45° while open).
defaultlit-material-speed-dial-action elements, closest-to-the-trigger first.

CSS parts

PartDescription
speed-dialThe container.
triggerThe main FAB button.
actionsThe popover surface holding the actions.
rippleThe trigger's state-layer element.
focus-ringThe trigger's focus indicator element.

Source on GitHub npm