lara-light-indigo

Speed Dial

When pressed, a floating action button can display multiple primary actions that can be performed on a page.

Linear
Circle, Semi-Circle and Quarter-Circle
Tooltip
Transition Duration, Icon and No Rotate Animation
Mask
Import via Module

import { SpeedDial } from 'primereact/speeddial';
 
Import via CDN

<script src="https://unpkg.com/primereact/core/core.min.js"></script>
<script src="https://unpkg.com/primereact/speeddial/speeddial.min.js"></script>
 
Getting Started

When pressed, a floating action button can display multiple primary actions that can be performed on a page. It has a collection of additional options defined by the model property. SpeedDial's position is calculated according to the container element with the position type style.


export const SpeedDialDemo = () => {

    const items = [
        {
            label: 'Add',
            icon: 'pi pi-pencil',
            command: () => {
                toast.current.show({ severity: 'info', summary: 'Add', detail: 'Data Added' });
            }
        },
        {
            label: 'Update',
            icon: 'pi pi-refresh',
            command: () => {
                toast.current.show({ severity: 'success', summary: 'Update', detail: 'Data Updated' });
            }
        },
        {
            label: 'Delete',
            icon: 'pi pi-trash',
            command: () => {
                toast.current.show({ severity: 'error', summary: 'Delete', detail: 'Data Deleted' });
            }
        }
    ];

    return (
        <SpeedDial model={items} />
    );
}
 
MenuModel API

SpeedDial uses the common MenuModel API to define the items, visit MenuModel API for details.

Type

SpeedDial has 4 types; linear, circle, semi-circle and quarter-circle.

Direction

Specifies the opening direction of actions. For the linear and semi-circle types; up, down, left and right. For the quarter-circle type; up-left, up-right, down-left and down-right.

Properties

Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.

NameTypeDefaultDescription
idstringnullUnique identifier of the element.
modelobjectnullMenuModel instance to define the action items.
visiblebooleanfalseSpecifies the visibility of the overlay.
classNamestringnullStyle class of the element.
styleobjectnullInline style of the element.
directionstringupSpecifies the opening direction of actions. Valid values are 'up', 'down', 'left', 'right', 'up-left', 'up-right', 'down-left' and 'down-right'
transitionDelaynumber30Transition delay step for each action item.
typestringlinearSpecifies the opening type of actions.
radiusnumber0Radius for *circle types.
maskbooleanfalseWhether to show a mask element behind the speeddial
disabledbooleanfalseWhether the component is disabled.
hideOnClickOutsidebooleantrueWhether the actions close when clicked outside.
buttonClassNamestringnullStyle class of the button element.
buttonStyleobjectnullInline style of the button element.
buttonTemplateanynullTemplate of button element.
maskClassNamestringnullStyle class of the mask element.
maskStyleobjectnullInline style of the mask element.
showIconstringpi pi-plusShow icon of the button element.
hideIconstringnullHide icon of the button element.
rotateAnimationbooleantrueDefined to rotate showIcon when hideIcon is not present.
Events
NameParametersDescription
onVisibleChangevisible: Whether the actions are visible.Fired when the visibility of element changed.
onClickevent: Browser event.Fired when the button element clicked.
onShow-Fired when the actions are visible.
onHide-Fired when the actions are hidden.
Styling

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

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

None.

Component Scale

Input Style

Ripple Effect

Free Themes

Built-in component themes created by the PrimeReact Theme Designer.

Bootstrap
Blue
Purple
Blue
Purple
Material Design
Indigo
Deep Purple
Indigo
Deep Purple
Material Design Compact
Indigo
Deep Purple
Indigo
Deep Purple
Tailwind
Tailwind Light
Fluent UI
Blue
PrimeOne Design - 2022 NEW
Lara Indigo
Lara Blue
Lara Purple
Lara Teal
Lara Indigo
Lara Blue
Lara Purple
Lara Teal
PrimeOne Design - 2021
Saga Blue
Saga Green
Saga Orange
Saga Purple
Vela Blue
Vela Green
Vela Orange
Vela Purple
Arya Blue
Arya Green
Arya Orange
Arya Purple
Premium Themes

Premium themes are only available exclusively for PrimeReact Theme Designer subscribers and therefore not included in PrimeReact core.

Soho Light
Soho Dark
Viva Light
Viva Dark
Mira
Nano

Legacy Free Themes

Nova
Nova Alt
Nova Accent
Luna Blue
Luna Green
Luna Amber
Luna Pink
Rhea

Premium Create-React-App Templates

Beautifully crafted premium create-react-app application templates by the PrimeTek design team.

Sakai
Atlantis
Freya
Ultima
Diamond
Sapphire
Serenity
Babylon
Avalon
Apollo
Roma