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
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add speed-dialOr install the full npm package:
npm install bigbulluiUsage
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 helpersZero 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
| Prop | Type | Description |
|---|---|---|
| items | SpeedDialItem[] | Menu items to fan out when open. |
| position | SpeedDialPosition | FAB corner position. |
| onOpenChange | (open: boolean) => void | Callback when open state changes. |
| children | React.ReactNode | FAB button content (usually SVG). |