Mohammad Shehadeh

Floating Toolbar

Navigation 2

About

Floating pill toolbar for text selection and canvas actions, with toggle buttons, separators and labels. Position it anywhere.

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

Code

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

Usage.tsx

'use client';

import {
  FloatingToolbar,
  FloatingToolbarButton,
  FloatingToolbarLabel,
  FloatingToolbarSeparator,
} from '@/components/ui/floating-toolbar';
import { Bold, Italic, Link2, Strikethrough, Underline } from 'lucide-react';

export default function FloatingToolbarDemo() {
  return (
    <div className="flex w-full max-w-xl justify-center py-6">
      <FloatingToolbar>
        <FloatingToolbarLabel>Aa</FloatingToolbarLabel>
        <FloatingToolbarSeparator />
        <FloatingToolbarButton active aria-label={'Bold'}>
          <Bold />
        </FloatingToolbarButton>
        <FloatingToolbarButton aria-label={'Italic'}>
          <Italic />
        </FloatingToolbarButton>
        <FloatingToolbarButton aria-label={'Underline'}>
          <Underline />
        </FloatingToolbarButton>
        <FloatingToolbarButton aria-label={'Strikethrough'}>
          <Strikethrough />
        </FloatingToolbarButton>
        <FloatingToolbarSeparator />
        <FloatingToolbarButton aria-label={'Add link'}>
          <Link2 />
          Link
        </FloatingToolbarButton>
      </FloatingToolbar>
    </div>
  );
}

More by Mohammad Shehadeh

View all
  • Feature Problem Cards

    Feature Problem Cards

    93
  • Ecommerce Category Page

    Ecommerce Category Page

    81
  • Feature Grid Spotlight Cards

    Feature Grid Spotlight Cards

    80
  • Split Login

    Split Login

    74
  • Comparison Section

    Comparison Section

    70
  • Dithered Shader CTA

    Dithered Shader CTA

    69
  • FAQ Two Column

    FAQ Two Column

    67
  • Comparison Table

    Comparison Table

    66

More in Navigation

View all
  • Sidebar

    Sidebar

    331
  • Navbar with Theme Toggle

    Navbar with Theme Toggle

    53
  • Stacked Circular Footer

    Stacked Circular Footer

    440
  • Progress Bar Stepper

    Progress Bar Stepper

    53
  • Dorpdown Navigation

    Dorpdown Navigation

    234
  • Nav List Card

    Nav List Card

    38
  • Tabs

    Tabs

    65
  • Pagination

    Pagination

    97

Explore more

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