SpeedDial
When pressed, a floating action button can display three to six related actions in the form of a Speed Dial.
If more than six actions are needed, something other than a FAB should be use to present them.
Basic SpeedDial
The floating action button can display related actions.
Preview
Usage
import { SpeedDial, SpeedDialAction, SpeedDialAction, SpeedDialIcon, IconButton } from 'archi-ui'
<SpeedDial
icon={<SpeedDialIcon icon={'+'} openIcon={'X'} open={openSpeedDial} />}
open={true}
>
<SpeedDialActions direction='up'>
<SpeedDialAction
icon={<IconButton color='warning' className='hover:bg-gray-200' size='sm'><span>S</span></IconButton>}
tooltipOpen
arrow
placement='left'
tooltipTitle="send"
open={openSpeedDial}
/>
<SpeedDialAction
icon={<IconButton color='error' className='hover:bg-gray-200' size='sm'><span>D</span></IconButton>}
tooltipOpen
arrow
placement='left'
tooltipTitle="delete"
open={openSpeedDial}
/>
<SpeedDialAction
icon={<IconButton color='info' className='hover:bg-gray-200' size='sm'><span>S</span></IconButton>}
tooltipOpen
arrow
placement='left'
tooltipTitle="share"
open={openSpeedDial}
/>
<SpeedDialAction
icon={<IconButton color='success' className='hover:bg-gray-200' size='sm'><span>W</span></IconButton>}
tooltipOpen
arrow
placement='left'
tooltipTitle="whatsapp"
open={openSpeedDial}
/>
</SpeedDialActions>
</SpeedDial>
Playground
Preview
Hidden
Tooltip
Tooltip arrow
Direction:
Placement:
Tooltip Placement:
Share
Print
Save
Copy
Controlled speed Dial
The open state of the component can be controlled with the open
/ onOpen
/ onClose
props.
Preview
Persistent action tooltips
The SpeedDialActions tooltips can be displayed persistently so that users don’t have to long press to see the tooltip on touch devices.
Preview
Share
Print
Save
Copy
SpeedDial API
API reference docs for the React SpeedDial component.
Props
Name | Type | Default | Description |
---|---|---|---|
children | node | - | SpeedDialActions to display when the SpeedDial is open. |
className | string | - | Override or extend the styles applied to the component. |
direction | 'up' | 'down' | 'left' | 'right' | 'up' | The direction the actions open relative to the floating action button. |
placement | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'bottom-right' | The placement of an SpeedDial, the position of the component is fixed(default). |
FabProps | object | - | Props applied to the Fab element. |
hidden | bool | false | If true , the SpeedDial is hidden. |
icon | node | - | The icon to display in the SpeedDial Fab. Component provides a default Icon with animation. |
open | bool | - | If true , the component is shown. |
onClose | func | - | Callback fired when the component is requests to be closed. Signature: function() => void . |
onOpen | func | - | Callback fired when the component is requests to be opened. Signature: function() => void . |
SpeedDialAction API
API reference docs for the React SpeedDialAction component.
Props
Name | Type | Default | Description |
---|---|---|---|
className | string | - | Override or extend the styles applied to the component. |
icon | node | - | The icon to display in the SpeedDialAction. |
open | bool | - | If true , the component is shown. |
tooltipOpen | bool | false | Make the tooltip always visible when the SpeedDial is open. |
tooltipPlacement | 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top' | 'left' | The placement of an SpeedDial, the position of the component is fixed(default). |
tooltipTitle | node | - | Label to display in the tooltip. |
arrow | bool | false | If true , tooltip arrow is shown. |
tooltipClasses | string | - | Classes applied to the Tooltip element. |
tooltipArrowClasses | string | - | Classes applied to the tooltip arrow element. |
icon | node | - | The icon to display in the SpeedDial Fab. Component provides a default Icon with animation. |
open | bool | - | If true , the component is shown. |
onClose | func | - | Callback fired when the component is requests to be closed. Signature: function() => void . |
onOpen | func | - | Callback fired when the component is requests to be opened. Signature: function() => void . |
SpeedDialIcon API
API reference docs for the React SpeedDialIcon component.
Props
Name | Type | Default | Description |
---|---|---|---|
className | string | - | Override or extend the styles applied to the component. |
icon | node | - | The icon to display. |
openIcon | node | - | The icon to display in the SpeedDial Floating Action Button when the SpeedDial is open. |
Last updated on