npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@indoui/react-text-editor

v1.1.5

Published

A powerful, feature-rich React text editor built on Tiptap with MS Word-like capabilities

Readme

@indoui/react-text-editor

A powerful, feature-rich React text editor built on Tiptap with MS Word-like capabilities.

Features

  • 📝 Rich Text Editing - Bold, italic, underline, strikethrough, subscript, superscript
  • 🎨 Text Styling - Font sizes, text colors, highlight colors
  • 📋 Formatting - Headings (H1-H3), blockquotes, code blocks
  • 📑 Lists - Bullet lists, ordered lists
  • 🔗 Links - Insert and edit hyperlinks
  • 🖼️ Media - Images (upload/URL), YouTube videos
  • 📊 Tables - Full table support with resizable columns
  • ↔️ Text Alignment - Left, center, right, justify
  • ↩️ History - Undo/Redo support
  • 🌙 Theming - Light/Dark theme with localStorage sync
  • 📏 Resizable - Adjustable editor height with drag handle
  • 🔧 Customizable - Modular toolbar configuration

Installation

npm install @indoui/react-text-editor
# or
yarn add @indoui/react-text-editor
# or
pnpm add @indoui/react-text-editor

Quick Start

import { TextEditor } from '@indoui/react-text-editor';
import '@indoui/react-text-editor/styles.css';

function App() {
  const [content, setContent] = useState('');

  return (
    <TextEditor
      value={content}
      onChange={setContent}
      placeholder="Start typing..."
    />
  );
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | value | string | '' | HTML content (controlled) | | onChange | (html: string) => void | - | Callback when content changes | | placeholder | string | 'Start typing...' | Placeholder text | | disabled | boolean | false | Disable the editor | | autoFocus | boolean | false | Auto focus on mount | | className | string | '' | Custom class name | | minHeight | string \| number | 200 | Minimum height | | maxHeight | string \| number | - | Maximum height (enables scrolling) | | height | string \| number | - | Initial height | | minWidth | string \| number | 200 | Minimum width | | maxWidth | string \| number | - | Maximum width | | width | string \| number | - | Initial width | | resizable | boolean | false | Enable resize handle | | theme | 'light' \| 'dark' | auto | Theme override | | toolbar | ToolbarConfig | all enabled | Toolbar configuration |

Toolbar Configuration

You can customize which toolbar buttons are shown:

<TextEditor
  value={content}
  onChange={setContent}
  toolbar={{
    bold: true,
    italic: true,
    underline: true,
    strikethrough: false, // Hide strikethrough
    subscript: false,
    superscript: false,
    bulletList: true,
    orderedList: true,
    headings: true,
    textAlign: true,
    link: true,
    image: true,
    video: false, // Hide video button
    table: true,
    fontSize: true,
    textColor: true,
    highlight: true,
    blockquote: true,
    codeBlock: true,
    horizontalRule: true,
    history: true,
  }}
/>

Resizable Height

Enable the resize handle to let users adjust editor height:

<TextEditor
  value={content}
  onChange={setContent}
  resizable={true}
  minHeight={200}
  maxHeight={600}
/>

Theming

The editor automatically syncs with localStorage.getItem('theme'). You can also override it:

// Auto theme (from localStorage)
<TextEditor value={content} onChange={setContent} />

// Force light theme
<TextEditor value={content} onChange={setContent} theme="light" />

// Force dark theme
<TextEditor value={content} onChange={setContent} theme="dark" />

Theme Utilities

import { setTheme, toggleTheme, useTheme } from '@indoui/react-text-editor';

// Programmatically set theme
setTheme('dark');

// Toggle between light/dark
toggleTheme();

// React hook for current theme
const theme = useTheme();

Advanced Usage

Access Individual Components

import { 
  TextEditor,
  Toolbar,
  ToolbarButton,
  FontSize,
} from '@indoui/react-text-editor';

Get HTML Output

const [html, setHtml] = useState('');

<TextEditor
  value={html}
  onChange={(newHtml) => {
    setHtml(newHtml);
    console.log('HTML output:', newHtml);
  }}
/>

Building from Source

If you want to build the library yourself:

# Clone the repository
git clone https://github.com/indoui/react-text-editor.git
cd react-text-editor

# Install dependencies
npm install

# Build the library
npm run build:lib

# The output will be in the dist/ folder

TypeScript Support

Full TypeScript support with exported types:

import type { 
  TextEditorProps, 
  ToolbarConfig, 
  EditorTheme 
} from '@indoui/react-text-editor';

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

MIT © IndoUI