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.
Name | Element |
---|---|
p-speeddial | Container element. |
p-speed-dial-button | Button element of speeddial. |
p-speed-dial-mask | Mask element of speeddial. |
p-speed-dial-list | List of the actions. |
p-speed-dial-item | Each action item of list. |
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" />
Key | Function |
---|---|
enter | Toggles the visibility of the menu. |
space | Toggles the visibility of the menu. |
down arrow | Opens the menu and moves focus to the first item. |
up arrow | Opens the menu and moves focus to the last item. |
Key | Function |
---|---|
enter | Activates the menuitem, closes the menu and sets focus on the menu button. |
escape | Closes the menu and sets focus on the menu button. |
arrow keys | Navigates between the menu items. |
home | Moves focus to the first item. |
end | Moves focus to the last item. |
API defines helper props, events and others for the PrimeNG Speed Dial module.
When pressed, a floating action button can display multiple primary actions that can be performed on a page.
Defines the input properties of the component.
Defines emit that determine the behavior of the component based on a given condition or report the actions that the component takes.
Defines the templates used by the component.