Overview
The Speed Dial component provides a floating action button (FAB) that expands to reveal a set of related actions. It supports multiple layout types (linear, circular) and various directions.Import
Basic Usage
Properties
Inputs
Array of menu items to display when expanded. Each item defines an action with icon and optional command.
Lucide icon name for the closed state trigger button
Lucide icon name for the open state trigger button
Layout type for the menu itemsOptions:
'linear' | 'circle' | 'semicircle' | 'quartercircle'Direction in which items expandOptions:
'up' | 'down' | 'left' | 'right' | 'up-left' | 'up-right' | 'down-left' | 'down-right'Radius in pixels for circular layouts (circle, semicircle, quartercircle)
When true, displays an overlay mask behind the speed dial when open
Custom background color for the trigger button (CSS color value)
Size of the trigger button in pixels
Size of each menu item button in pixels
Gap between items in linear layout (pixels)
When true, the speed dial closes automatically after an item is selected
ARIA label for the trigger button for accessibility
Outputs
Emitted when the speed dial is opened or closed. Passes the new open state.
Emitted when a menu item is clicked. Passes the selected item and the original event.
SpeedDialItem Interface
Examples
Linear Direction
Circular Layouts
With Mask Overlay
Custom Styling
With Commands and Tooltips
Disable Auto-Close
Accessibility
The Speed Dial component includes comprehensive accessibility features:- Keyboard Navigation: Press Escape to close the menu
- Click Outside: Automatically closes when clicking outside
- ARIA Labels: Proper labels for trigger and items
- Disabled State: Respects and communicates disabled items
- Focus Management: Manages focus appropriately
Keyboard Support
- Escape: Close the speed dial menu
- Click/Touch: Toggle menu or select items
Behavior
Auto-Close
The speed dial automatically closes when:- An item is clicked (if
closeOnItemSelectis true) - User clicks outside the component
- User presses the Escape key
- The mask overlay is clicked (if
showMaskis true)
Transition Animation
Items animate in/out with staggered delays:- Linear layout: 34ms/22ms delay steps (open/close)
- Circular layouts: 26ms/16ms delay steps (open/close)
- Animation reverses on close (last item first)
Component Details
- Selector:
magary-speed-dial - Source:
/home/daytona/workspace/source/projects/ng-magary/src/lib/Button/speed-dial/speed-dial.ts - Standalone: Yes (with CommonModule, LucideAngularModule)
- Change Detection: OnPush
