OverviewDocsPreviewsBuilder

Compound Components

Break down Tiptide into individual subcomponents for absolute layout flexibility.

The power of Tiptide lies in its Compound Component API. Instead of using <TiptideEditor />, which renders a preconfigured layout, you can compose your own editor from scratch.

This allows you to create unique layout hierarchies—such as putting the toolbar below the textarea, adding sidebars, wrapping components in custom divs, or injecting additional UI elements.

Available Subcomponents

  • <TiptideProvider>: Context provider that initializes the Tiptap editor engine and feeds state to all other components. It accepts standard editor props.
  • <TiptideTextarea>: The actual editable text-area canvas. Optimized to prevent unnecessary typing lag and re-renders.
  • <Toolbar>: The toolbar container. By default, rendering <Toolbar /> without children loads a preconfigured toolset. Alternatively, you can pass custom children.
  • <BubbleMenu>: Contextual floating menu that appears when a user highlights text. Contains text formatting utilities.
  • <ImageBubbleMenu>: Contextual floating menu that appears when a user clicks on an image. Contains image alignment and removal controls.

Example

tsx
import { 
  TiptideProvider, 
  TiptideTextarea, 
  Toolbar, 
  BubbleMenu 
} from 'tiptide';

export function CustomEditor() {
  return (
    <TiptideProvider content="<p>Custom arrangement!</p>">
      <div className="flex flex-col border border-neutral-200 rounded-lg overflow-hidden">
        
        {/* We place the editor editing canvas first */}
        <div className="p-4 min-h-[200px]">
          <TiptideTextarea />
        </div>

        {/* And we put the toolbar at the bottom of the editor! */}
        <Toolbar className="border-t border-b-0 bg-neutral-50 dark:bg-neutral-900 dark:border-neutral-800" />

        {/* Floating Bubble Menu */}
        <BubbleMenu />
      </div>
    </TiptideProvider>
  );
}