Componentnavigation1.09 KB gzipZero dependencies

SpeedDial

FAB that fans out mini action buttons in an arc with staggered scale-in when open; Escape closes.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add speed-dial

Or install the full npm package:

npm install bigbullui

Usage

tsx8 lines
import { SpeedDial } from "@/components/ui/speed-dial" <SpeedDial  items={[{ id: "1", label: "New Message", onClick: () => {} }]}  onOpenChange={() => {}}>  <svg w-5 h-5 viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 14 13"></polygon></svg></SpeedDial>

Source code

speed-dial.tsx + 2 helpers

Zero third-party dependencies (3 local files shown in tabs below).

tsxspeed-dial.tsx159 lines
"use client"; import * as React from "react";import { registerEscapeLayer } from "./lib/focus-trap";import { cn } from "./lib/utils"; export type SpeedDialPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left"; export type SpeedDialProps = {  items: SpeedDialItem[];  position?: SpeedDialPosition;  onOpenChange?: (open: boolean) => void;  children?: React.ReactNode;} & React.HTMLAttributes<HTMLElement>; export type SpeedDialItem = {  id: string;  label: string;

Props

PropTypeDescription
itemsSpeedDialItem[]Menu items to fan out when open.
positionSpeedDialPositionFAB corner position.
onOpenChange(open: boolean) => voidCallback when open state changes.
childrenReact.ReactNodeFAB button content (usually SVG).