Skip to content
Stylhero 0.8.0
Components

Core

Layout and type

Inputs

Overlays

Navigation

Data display

Charts

Transitions and utilities

Page pieces (landing pages, portfolios, docs)

Icons

Components / Inputs

SpeedDial

A Fab that opens a few related actions, each with a visible label.

import { SpeedDial } from "@stylhero/ui";

Example

Code
import { Box, SpeedDial, MailIcon, PlusIcon, SearchIcon } from "@stylhero/ui";

function SpeedDialExample() {
  return (
    <Box p={4} style={{ minHeight: 220, display: "flex", alignItems: "flex-end" }}>
      <SpeedDial label="Quick actions" actions={[
        { label: "New build", icon: <PlusIcon />, onClick: () => {} },
        { label: "Search parts", icon: <SearchIcon />, onClick: () => {} },
        { label: "Email", icon: <MailIcon />, onClick: () => {} },
      ]} />
    </Box>
  );
}

Props

PropTypeDefaultDescription
actions required SpeedDialAction[] -
label required string - Accessible name of the main button, e.g. "Quick actions".
direction "up" | "left" "up" Which way the actions fan out.
fixed boolean -
icon ReactNode - Main button icon; defaults to a plus that turns into an X.

Also takes every <div> attribute (id, style, data-*, aria-*, event handlers…), passed to that element.

Types

type SpeedDialAction = { label: string; icon: ReactNode; onClick: () => void };

Keyboard

KeyDoes
Enter / SpaceOpens the actions
TabMoves through the actions
EscCloses them

Accessibility

  • The main button has aria-expanded and aria-controls; each action is a labelled button.

Generated from src/components/Fab.tsx. Something wrong or missing? Open an issue.