A floating action button that reveals a set of quick actions on click.
Made by raouf.codesOverview
Core Concept
The SpeedDial component provides a mobile-friendly floating action button that expands to reveal a set of quick action items. Built with Framer Motion, it delivers smooth staggered animations and full keyboard accessibility.
Key Features
- Staggered animations — Items reveal with cascading entrance/exit effects
- Keyboard navigation — Full arrow key support with Escape to close
- Focus management — Auto-focus on open with proper focus trapping
- Link obfuscation — Optional base64-encoded hrefs for spam protection
- Orientation support — Vertical or horizontal menu layouts
Anatomy
SpeedDial— Root component (context provider, keyboard handling)SpeedDial.Trigger— Toggle button to open/close the menuSpeedDial.Menu— Animated container for action itemsSpeedDial.Item— Individual action item with icon and linkuseSpeedDial()— Hook for custom integrations
Installation
Usage
Basic
Obfuscated Links
For email protection or other anti-scraping needs, use base64-encoded hrefs with the obfuscated flag:
Using useSpeedDial() for custom items
API Reference
SpeedDial (root)
| Prop | Type | Default |
|---|---|---|
orientation? | enum | "vertical" |
expansion? | enum | "reverse" |
size? | enum | "md" |
intent? | enum | "primary" |
styling? | enum | "solid" |
shape? | enum | "pill" |
elevation? | enum | "raised" |
defaultOpen? | boolean | false |
className? | string | - |
SpeedDial.Trigger
The trigger button that opens/closes the menu. Inherits variant props from the root.
| Prop | Type | Default |
|---|---|---|
children | React.ReactNode | - |
className? | string | - |
...props? | ButtonProps | - |
SpeedDial.Menu
The animated container for speed dial items.
| Prop | Type | Default |
|---|---|---|
children | React.ReactNode | - |
className? | string | - |
SpeedDial.Item
Individual action item with icon and link.
| Prop | Type | Default |
|---|---|---|
item | SpeedDialItemData | - |
index? | number | 0 |
className? | string | - |
...props? | ComponentProps<"a"> | - |
Accessibility
- Full keyboard navigation support (Escape to close)
- Proper ARIA attributes for menu role
- Focus management on open/close
- Screen reader friendly labels
Credits
Built by raouf.codes. The source code is available on GitHub.
Last updated: 3/21/2026