Speed Dial

SpeedDial is a floating button with a popup menu.


import { SpeedDialModule } from 'primeng/speeddial';

SpeedDial items are defined with the model property based on MenuModel API. Default orientation of the items is linear and direction property is used to define the position of the items related to the button.


<p-speedDial [model]="items" direction="up" />
<p-speedDial [model]="items" direction="down" />
<p-speedDial [model]="items" direction="left" />
<p-speedDial [model]="items" direction="right" />

Items can be displayed around the button when type is set to circle. Additional radius property defines the radius of the circle.


<p-speedDial 
    [model]="items" 
    type="circle" 
    [radius]="80" 
    buttonClassName="p-button-warning" />

When type is defined as semi-circle, items are displayed in a half-circle around the button.


<p-speedDial 
    [model]="items" 
    direction="up" 
    [radius]="80" 
    type="semi-circle" />
<p-speedDial 
    [model]="items" 
    direction="down" 
    [radius]="80" 
    type="semi-circle" />
<p-speedDial 
    [model]="items" 
    direction="left" 
    [radius]="80" 
    type="semi-circle" />
<p-speedDial 
    [model]="items"
    direction="right" 
    [radius]="80" 
    type="semi-circle" />

When type is defined as quarter-circle, items are displayed in a half-circle around the button.


<p-speedDial 
    [model]="items" 
    radius="120"
    direction="up-left" 
    type="quarter-circle" 
    buttonClassName="p-button-success" />
<p-speedDial 
    [model]="items" 
    radius="120" 
    direction="up-right"
    type="quarter-circle" 
    buttonClassName="p-button-success" />
<p-speedDial 
    [model]="items" 
    radius="120" 
    direction="down-left" 
    type="quarter-circle" 
    buttonClassName="p-button-success" />
<p-speedDial 
    [model]="items" 
    radius="120" 
    direction="down-right" 
    type="quarter-circle" 
    buttonClassName="p-button-success" />

Items display a tooltip on hover when a standalone Tooltip is present with a target that matches the items.


<p-speedDial 
    [model]="leftTooltipItems" 
    className="speeddial-right" 
    direction="up" />
<p-speedDial 
    [model]="tooltipItems" 
    className="speeddial-left" 
    direction="up" />

Adding mask property displays a modal layer behind the popup items.


<p-speedDial 
    [model]="items" 
    direction="up" 
    [mask]="true" />

SpeedDial sample with an outlined button, custom icons and transitionDelay.


<p-speedDial 
    [model]="items" 
    direction="up" 
    transitionDelay="80" 
    showIcon="pi pi-bars" 
    hideIcon="pi pi-times" 
    buttonClassName="p-button-outlined" />

Following is the list of structural style classes, for theming classes visit theming page.

NameElement
p-speeddialContainer element.
p-speed-dial-buttonButton element of speeddial.
p-speed-dial-maskMask element of speeddial.
p-speed-dial-listList of the actions.
p-speed-dial-itemEach action item of list.

Screen Reader

SpeedDial component renders a native button element that implicitly includes any passed prop. Text to describe the button can be defined with the aria-labelledby or aria-label props. Addititonally the button includes includes aria-haspopup, aria-expanded for states along with aria-controls to define the relation between the popup and the button.

The popup overlay uses menu role on the list and each action item has a menuitem role with an aria-label as the menuitem label. The id of the menu refers to the aria-controls of the button.


<p-speedDial aria-label="Options" />

Menu Button Keyboard Support

KeyFunction
enterToggles the visibility of the menu.
spaceToggles the visibility of the menu.
down arrowOpens the menu and moves focus to the first item.
up arrowOpens the menu and moves focus to the last item.

Menu Keyboard Support

KeyFunction
enterActivates the menuitem, closes the menu and sets focus on the menu button.
escapeCloses the menu and sets focus on the menu button.
arrow keysNavigates between the menu items.
homeMoves focus to the first item.
endMoves focus to the last item.