Skip to main content

Overview

FloatingToolbar is a self-contained component that displays a formatting toolbar when text is selected. It handles selection tracking internally and exposes visibility state via context.
Floating toolbar screenshot

Features

  • API — compound components with auto-visibility
  • Selection tracking — automatically shows/hides on text selection
  • Block selection support — also works when blocks are selected
  • frozen prop — pause selection tracking when popups are open
  • TypeScript — full type safety

Installation

Basic Usage

API Reference

FloatingToolbar (Root)

Root component that handles selection tracking.
Props: Render Props API:

FloatingToolbar.Content

Floating content panel. Automatically hides when no selection.
Props:

FloatingToolbar.Group

Groups related buttons together.

FloatingToolbar.Button

Individual toolbar button.
Props:

FloatingToolbar.Separator

Visual separator between groups.

Examples

With Turn Into Button

Rich Formatting Toolbar

Styling

CSS Variables

Custom Styles

Best Practices

ActionMenuList

Open from “Turn into” button

FloatingBlockActions

Block-level action buttons