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
  • Ecommerce Category Page

    Ecommerce Category Page

    99
  • Feature Problem Cards

    Feature Problem Cards

    99
  • Split Login

    Split Login

    93
  • Feature Grid Spotlight Cards

    Feature Grid Spotlight Cards

    91
  • Comparison Section

    Comparison Section

    81
  • Rounded Top Footer

    Rounded Top Footer

    79
  • Comparison Table

    Comparison Table

    78
  • FAQ Two Column

    FAQ Two Column

    76

More in Navigation

View all
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    76
  • Footer with Big Wordmark

    Footer with Big Wordmark

    40
  • Sidebar

    Sidebar

    392
  • Oversized 404 Numeral

    Oversized 404 Numeral

    78
  • Navbar with Theme Toggle

    Navbar with Theme Toggle

    67
  • NavBar

    NavBar

    2
  • Pagination

    Pagination

    109
  • Tabs like bookmark

    Tabs like bookmark

    82

Explore more

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