Skip to content

SpeedDial

SpeedDial provides an expanding floating action group that fans out into secondary action pills with staggered spring animations, optional backdrop dimming, and full tactile haptic support.

Usage

SpeedDialExample.tsx
import { useState } from 'react';
import { SpeedDial } from '@masumdev/rn-ui';
import { FileText, QrCode, Upload } from 'lucide-react-native';
export function SpeedDialExample() {
const [open, setOpen] = useState(false);
return (
<SpeedDial
open={open}
onOpenChange={setOpen}
tone="primary"
placement="bottom-end"
offset={20}
actions={[
{
id: 'doc',
label: 'Create Document',
icon: ({ color, size }) => <FileText color={color} size={size} />,
onPress: () => console.log('Create Doc'),
},
{
id: 'qr',
label: 'Scan QR Code',
icon: ({ color, size }) => <QrCode color={color} size={size} />,
tone: 'accent',
onPress: () => console.log('Scan QR'),
},
{
id: 'upload',
label: 'Upload File',
icon: ({ color, size }) => <Upload color={color} size={size} />,
tone: 'success',
onPress: () => console.log('Upload File'),
},
]}
/>
);
}

Props API

PropTypeDefaultDescription
actions*SpeedDialActionItem[]—List of secondary action items revealed on expansion.
openboolean—Controlled expanded open state.
defaultOpenbooleanfalseUncontrolled initial open state.
onOpenChange(open: boolean) => void—Callback fired when expanded state changes.
iconRenderIcon—Custom main icon (defaults to plus icon rotated by 45deg on open).
activeIconRenderIcon—Icon displayed when expanded (bypasses default 45deg rotation).
placement"bottom-end" | "bottom-start" | "top-end" | "top-start""bottom-end"Screen anchor placement.
offsetnumber20Offset distance in points from screen edges.
toneComponentTone"primary"Color tone for the main floating action button.
size"sm" | "md" | "lg""md"Dimension scale for main and secondary action buttons.
overlaybooleantrueRender semi-transparent backdrop behind expanded actions.
overlayColorstring—Custom backdrop overlay background color.
hapticbooleantrueEnable tactile feedback on expand and action selection.
glassbooleanfalseEnable translucent glassmorphism label styling.

SpeedDialActionItem

PropTypeDefaultDescription
id*string—Unique identifier for the action item.
icon*RenderIcon—Action icon element or render function.
labelstring—Text label badge displayed next to the action button.
toneComponentTone—Color tone override for this specific action button.
disabledbooleanfalseWhether this action button is disabled.
onPress*() => void—Callback fired when action button is pressed.