Mohammad Shehadeh

Floating Action Button

Buttons 1

About

Expanding speed-dial FAB: a primary trigger that rotates open to stagger a stack of secondary actions on any side. Compound API.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Floating Action Button to your project and fits it to your theme.

Code

How Floating Action Button is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

'use client';

import {
  FloatingActionButton,
  FloatingActionButtonItem,
  FloatingActionButtonList,
  FloatingActionButtonTrigger,
} from '@/components/ui/floating-action-button';
import { ImageIcon, Link2, Plus, Type } from 'lucide-react';

export default function FloatingActionButtonDemo() {
  return (
    <div className="flex h-60 w-full max-w-xl items-end justify-center">
      <FloatingActionButton>
        <FloatingActionButtonList>
          <FloatingActionButtonItem aria-label={'Add text'}>
            <Type />
          </FloatingActionButtonItem>
          <FloatingActionButtonItem aria-label={'Add image'}>
            <ImageIcon />
          </FloatingActionButtonItem>
          <FloatingActionButtonItem aria-label={'Add link'}>
            <Link2 />
          </FloatingActionButtonItem>
        </FloatingActionButtonList>
        <FloatingActionButtonTrigger aria-label={'Create'}>
          <Plus />
        </FloatingActionButtonTrigger>
      </FloatingActionButton>
    </div>
  );
}

Dependencies

More by Mohammad Shehadeh

View all
  • Feature Problem Cards

    Feature Problem Cards

    84
  • Feature Grid Spotlight Cards

    Feature Grid Spotlight Cards

    70
  • Dithered Shader CTA

    Dithered Shader CTA

    63
  • Ecommerce Category Page

    Ecommerce Category Page

    61
  • Split Login

    Split Login

    60
  • Comparison Table

    Comparison Table

    59
  • FAQ Two Column

    FAQ Two Column

    59
  • Comparison Section

    Comparison Section

    57

More in Buttons

View all
  • Button Save

    Button Save

    46
  • Button

    Button

    20
  • Eclipse Button

    Eclipse Button

    5
  • Button

    Button

    6
  • Button

    Button

    14
  • Button Group

    Button Group

    37
  • Button

    Button

    32
  • Split Button

    Split Button

    32

Explore more

Part of Hirael — browse the full library on 21st.dev.