Skip to content

Conversation

@Adebesin-Cell
Copy link
Contributor

@Adebesin-Cell Adebesin-Cell commented Nov 21, 2025

✨ feat: Add Rich Text Editor

πŸ“ Description

This PR introduces a fully themeable, composable, Chakra-native Rich Text Editor, built on top of Tiptap and designed to feel seamless within the Chakra UI ecosystem.

It provides a complete set of primitivesβ€”Root, Toolbar, ControlsGroup, Control, and Contentβ€”that allow developers to compose their own editor experiences with minimal effort while ensuring consistent Chakra styling.

⛳️ Current Behavior

Chakra UI does not provide an official rich text editor.
Developers typically implement Tiptap manually, leading to:

  • inconsistent UI styles
  • duplicated toolbar logic
  • lack of Chakra-aware components
  • inaccessible or non-theme-compliant controls

πŸš€ New Behavior

This PR adds a Chakra-first Rich Text Editor with:

🎨 Composable Chakra Components

  • RichTextEditor.Root
  • Toolbar
  • ControlsGroup
  • Control
  • Content

✍️ Built-in Editor Controls

  • Text formatting: Bold, Italic, Underline, Strikethrough, Code
  • Headings: H1–H4
  • Lists: Bullet, Ordered
  • Blocks: Blockquote, Horizontal Rule
  • Script: Subscript, Superscript
  • Alignment: Left, Center, Right, Justify
  • History: Undo, Redo

πŸ”— Link Management

  • Add link
  • Remove link

πŸŽ› Additional Features

  • Theme-aware styles using Chakra tokens
  • Accessible tooltips
  • Minimal base styling for consistent typography
  • Fully extensible: developers can register new controls or Tiptap extensions

🧩 Example Usage

import { RichTextEditor, useEditor } from "@chakra-ui/tiptap-editor"

export function BasicEditor() {
  const editor = useEditor({
    content: "<p>Start typing to see the editor in action...</p>",
  })

  return (
    <RichTextEditor.Root editor={editor}>
      <RichTextEditor.Toolbar>
        <RichTextEditor.ControlsGroup>
          <RichTextEditor.Bold />
          <RichTextEditor.Italic />
          <RichTextEditor.Underline />
          <RichTextEditor.Strike />
          <RichTextEditor.Code />
        </RichTextEditor.ControlsGroup>

        <RichTextEditor.ControlsGroup>
          <RichTextEditor.H1 />
          <RichTextEditor.H2 />
          <RichTextEditor.H3 />
          <RichTextEditor.H4 />
        </RichTextEditor.ControlsGroup>

        <RichTextEditor.ControlsGroup>
          <RichTextEditor.Hr />
          <RichTextEditor.BulletList />
          <RichTextEditor.OrderedList />
          <RichTextEditor.Subscript />
          <RichTextEditor.Superscript />
        </RichTextEditor.ControlsGroup>

        <RichTextEditor.ControlsGroup>
          <RichTextEditor.Unlink />
        </RichTextEditor.ControlsGroup>

        <RichTextEditor.ControlsGroup>
          <RichTextEditor.AlignLeft />
          <RichTextEditor.AlignCenter />
          <RichTextEditor.AlignJustify />
          <RichTextEditor.AlignRight />
        </RichTextEditor.ControlsGroup>

        <RichTextEditor.ControlsGroup>
          <RichTextEditor.Undo />
          <RichTextEditor.Redo />
        </RichTextEditor.ControlsGroup>
      </RichTextEditor.Toolbar>

      <RichTextEditor.Content />
    </RichTextEditor.Root>
  )
}

πŸ’£ Breaking Changes?

No.
This is a new, opt-in package and does not affect existing Chakra UI components or APIs.

πŸ“ Additional Information

  • Fully Chakra-styled and theme-aware.
  • All controls and UI follow Chakra design principles.
  • Designed to be accessible and screen-reader friendly.
  • Easy to extend: developers can create new custom controls or wrap additional Tiptap extensions.
  • Significantly reduces the setup required to use Tiptap inside Chakra-based apps.

πŸ“š Examples for View

A comprehensive set of Storybook examples demonstrates what you can build with the Chakra Rich Text Editor using Tiptap.
These examples showcase:

  • Basic editor setup
  • Controlled editor usage
  • Placeholder support
  • Bubble menus
  • Floating menus
  • Task lists
  • Color controls
  • Custom icons
  • Custom control creation
  • Image support

@changeset-bot
Copy link

changeset-bot bot commented Nov 21, 2025

⚠️ No Changeset found

Latest commit: 92d95b2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Nov 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
chakra-ui-storybook Ready Ready Preview Dec 19, 2025 8:03pm
chakra-v3-docs Ready Ready Preview Dec 19, 2025 8:03pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant