Saikat
Back to npm packages

scribex-editor

v1.1.0

A modern, feature-rich WYSIWYG editor for React built on TipTap and shadcn/ui

152 / monthMIT LicenseUpdated May 16, 2026
reacteditortiptapwysiwygrich-textshadcntailwindcssscribex

โœ๏ธ Scribex Editor

A modern, feature-rich WYSIWYG editor for React โ€” built on TipTap and shadcn/ui.


Drop-in rich text editor with 30+ toolbar components, dark mode, themes, slash commands, and AI-friendly content output.


๐Ÿงฉ What it includes

Feature Description
โœ๏ธ Rich text formatting โ€” bold, italic, underline, strike, code
๐Ÿ“‹ Headings & lists โ€” H1โ€“H6, bullet, ordered, task lists
๐Ÿ–ผ๏ธ Media โ€” images, videos, GIFs (Giphy), file attachments
๐Ÿ“ Layout โ€” tables, multi-column, horizontal rules, blockquotes
๐Ÿ’ป Code โ€” syntax-highlighted code blocks, inline code, code view
๐Ÿงฎ Advanced โ€” math equations (KaTeX), Mermaid diagrams, Excalidraw whiteboard
๐Ÿฆ Embeds โ€” Twitter/X, iframes, drawing tool
๐Ÿ” Productivity โ€” slash commands, @mentions, search & replace, character count
๐ŸŽจ Theming โ€” dark/light mode, 8 color themes, custom border radius
๐ŸŒ i18n โ€” English, Vietnamese, Simplified Chinese, Brazilian Portuguese, Hungarian, Finnish
๐Ÿ“„ Export/Import โ€” PDF export, Word export, Word import

๐Ÿ“ฆ Installation

Requirements

  • React v18 or higher
  • Node.js v18 or higher

Install

npm install scribex-editor
# or
pnpm add scribex-editor
# or
yarn add scribex-editor

Import styles

Add both stylesheets to your app entry point:

import 'scribex-editor/styles.css';
import 'reactjs-tiptap-editor/style.css';

๐Ÿš€ Quick Start

import { ScribexEditor, ScribexThemeProvider } from 'scribex-editor';
import 'scribex-editor/styles.css';
import 'reactjs-tiptap-editor/style.css';

function App() {
  return (
    <ScribexThemeProvider>
      <ScribexEditor
        initialContent="<p>Start typing...</p>"
        onChange={(content) => console.log(content)}
      />
    </ScribexThemeProvider>
  );
}

Next.js users: Add "use client" at the top of any file that imports ScribexEditor โ€” it requires browser APIs.


๐ŸŽจ Theme Customization

Provider configuration

<ScribexThemeProvider
  defaultConfig={{
    mode: 'dark',        // 'light' | 'dark'
    color: 'blue',       // see color options below
    borderRadius: 0.5,   // 0โ€“1
    locale: 'en',        // see locale options below
  }}
>
  <ScribexEditor ... />
</ScribexThemeProvider>

Available colors

Value Preview
default Neutral gray
red Red accent
blue Blue accent
green Green accent
orange Orange accent
rose Rose accent
violet Violet accent
yellow Yellow accent

Available locales

Value Language
en English
vi Vietnamese
zh_CN Simplified Chinese
pt_BR Brazilian Portuguese
hu_HU Hungarian
fi Finnish

Dynamic theme switching

import { useScribexTheme } from 'scribex-editor';

function ThemeControls() {
  const { mode, setMode, color, setColor } = useScribexTheme();

  return (
    <div>
      <button onClick={() => setMode(mode === 'light' ? 'dark' : 'light')}>
        Toggle {mode === 'light' ? 'Dark' : 'Light'} Mode
      </button>
      <select value={color} onChange={(e) => setColor(e.target.value as ThemeColor)}>
        {['default','red','blue','green','orange','rose','violet','yellow'].map(c => (
          <option key={c} value={c}>{c}</option>
        ))}
      </select>
    </div>
  );
}

โš™๏ธ Props Reference

<ScribexEditor>

Prop Type Default Description
initialContent string '' Initial HTML content
onChange (content: string) => void โ€” Fires on content change (debounced)
onEditorReady (editor: Editor) => void โ€” Fires when editor is initialized
placeholder string "Press '/' for commands" Placeholder text
characterLimit number 10000 Maximum character limit
editable boolean true Enable or disable editing
className string โ€” Class on the container element
toolbarClassName string โ€” Class on the toolbar element
contentClassName string โ€” Class on the content area
imageUpload (file: File) => Promise<string> โ€” Custom image upload handler; return the URL
videoUpload (file: File) => Promise<string> โ€” Custom video upload handler; return the URL
attachmentUpload (file: File) => Promise<string> โ€” Custom attachment upload handler; return the URL
giphyApiKey string โ€” Giphy API key to enable GIF search
mentionUsers Array<{id, label, avatar?}> [] Users available for @mentions
showToolbar boolean true Show or hide the toolbar
showBubbleMenus boolean true Show or hide bubble menus on selection
showSlashCommands boolean true Enable / slash command palette
showCharacterCount boolean true Show character count indicator
debounceMs number 300 Debounce delay for onChange (ms)

<ScribexThemeProvider>

Prop Type Default Description
defaultConfig ScribexThemeConfig โ€” Initial theme settings
children ReactNode โ€” Required โ€” wrap your editor here

<EditorPreview>

Read-only display of HTML content with the same styles as the editor.

import { EditorPreview } from 'scribex-editor';

<EditorPreview content="<p>Hello <strong>World</strong></p>" />

๐Ÿ”Œ Editor Instance

Access the TipTap editor instance directly via onEditorReady:

import { ScribexEditor } from 'scribex-editor';
import type { Editor } from 'scribex-editor';

function App() {
  const handleEditorReady = (editor: Editor) => {
    editor.commands.insertContent('<p>Injected content</p>');
    editor.commands.focus();
  };

  return <ScribexEditor onEditorReady={handleEditorReady} />;
}

๐Ÿ› ๏ธ Custom Toolbar

Build a fully custom toolbar by composing individual toolbar components:

import {
  ScribexEditor,
  ScribexThemeProvider,
  RichTextBold,
  RichTextItalic,
  RichTextHeading,
  RichTextBulletList,
  RichTextOrderedList,
  RichTextLink,
  RichTextImage,
  RichTextUndo,
  RichTextRedo,
} from 'scribex-editor';

function App() {
  return (
    <ScribexThemeProvider>
      <ScribexEditor
        showToolbar={false}  // hide the built-in toolbar
        onChange={(c) => console.log(c)}
      />
    </ScribexThemeProvider>
  );
}

All available toolbar components

Component Description
RichTextBold Bold
RichTextItalic Italic
RichTextUnderline Underline
RichTextStrike Strikethrough
RichTextCode Inline code
RichTextCodeBlock Code block
RichTextLink Hyperlink
RichTextImage Image
RichTextVideo Video
RichTextImageGif GIF (Giphy)
RichTextBlockquote Blockquote
RichTextBulletList Bullet list
RichTextOrderedList Ordered list
RichTextTaskList Task / checklist
RichTextHeading Headings H1โ€“H6
RichTextUndo / RichTextRedo History
RichTextColor Text color
RichTextHighlight Background highlight
RichTextAlign Text alignment
RichTextIndent Indent / outdent
RichTextFontFamily Font family
RichTextFontSize Font size
RichTextLineHeight Line height
RichTextTable Table
RichTextColumn Multi-column layout
RichTextEmoji Emoji picker
RichTextKatex Math equations (KaTeX)
RichTextMermaid Mermaid diagrams
RichTextExcalidraw Excalidraw whiteboard
RichTextDrawer Drawing tool
RichTextIframe Iframe embed
RichTextTwitter Twitter / X embed
RichTextCallout Callout block
RichTextAttachment File attachment
RichTextExportPdf Export to PDF
RichTextImportWord Import from Word
RichTextExportWord Export to Word
RichTextSearchAndReplace Search and replace
RichTextClear Clear formatting
RichTextMoreMark More marks menu
RichTextTextDirection Text direction (RTL/LTR)
RichTextCodeView HTML source view
RichTextHorizontalRule Horizontal rule

๐Ÿ“ Project Structure

scribex-editor/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ ScribexEditor.tsx     # Main TipTap-based editor component
โ”‚   โ”‚   โ”œโ”€โ”€ RichTextEditor.tsx    # Quill-based alternative editor
โ”‚   โ”‚   โ”œโ”€โ”€ EditorPreview.tsx     # Read-only content preview
โ”‚   โ”‚   โ”œโ”€โ”€ ThemeProvider.tsx     # React Context for theming & locale
โ”‚   โ”‚   โ””โ”€โ”€ index.ts
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ”œโ”€โ”€ cn.ts                 # Class name utility (clsx + tailwind-merge)
โ”‚   โ”‚   โ”œโ”€โ”€ helpers.ts            # debounce, createObjectURL, base64 helpers
โ”‚   โ”‚   โ””โ”€โ”€ index.ts
โ”‚   โ”œโ”€โ”€ emojis.ts                 # EMOJI_LIST data
โ”‚   โ””โ”€โ”€ index.ts                  # Public API barrel export
โ”œโ”€โ”€ dist/                         # Compiled output (git-ignored)
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsup.config.ts
โ””โ”€โ”€ tsconfig.json

๐Ÿ› ๏ธ Development

# Clone the repo
git clone https://github.com/mirzasaikatahmmed/scribex-editor.git
cd scribex-editor

# Install dependencies
npm install

# Build the package
npm run build

# Watch mode (rebuilds on save)
npm run dev

๐Ÿ“‹ Changelog

See CHANGELOG.md for the full version history.

v1.0.8 โ€” Current

  • ๐Ÿ“ Full open source documentation suite (CONTRIBUTING, CODE_OF_CONDUCT, REPOSITORY_RULES, CHANGELOG)
  • โœจ Complete Next.js 15 + React 19 demo app with live theme controls and HTML output panel

v1.0.7

  • ๐Ÿ”’ Security: malware scanner script and GitHub Actions workflow added

v1.0.5

  • ๐Ÿ› ๏ธ Tailwind config path fixes and .gitignore cleanup

v1.0.4

  • ๐Ÿ“ README documentation improvements

v1.0.3

  • ๐Ÿš€ CI/CD publish workflow stabilised

v1.0.2

  • โœจ Added RichTextEditor (Quill-based) and EditorPreview components
  • ๐Ÿ—๏ธ Repo flattened from pnpm monorepo to single npm package

v1.0.0

  • ๐ŸŽ‰ Initial release โ€” ScribexEditor, ScribexThemeProvider, 30+ toolbar components, 6 locales, full TipTap feature set

๐Ÿค Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss.

  1. Fork the repository
  2. Create your branch: git checkout -b feat/your-feature
  3. Make changes, build, and test
  4. Push and open a PR

Please read CONTRIBUTING.md for full guidelines and CODE_OF_CONDUCT.md before participating. All contributors are listed in CONTRIBUTORS.md.


๐Ÿ’› Support

If Scribex Editor saves you time, consider supporting the project:


Made with โค๏ธ by Mirza Saikat Ahmmed