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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@appflowyinc/editor

v0.1.13

Published

AppFlowy Web Editor

Downloads

829

Readme

AppFlowy Web Editor

A modern editor library with support for rich text, markdown, and code editing.

✨ Features

  • 🌓 Day/Night mode switching
  • 🌍 Multi-language support
  • 📱 Responsive design
  • 💪 TypeScript support
  • 📝 Rich text, markdown, and code editing
  • 📦 Easy to integrate
  • 🎉 And more!

📦 Installation

To install the AppFlowy Web Editor, run the following command:

npm install @appflowyinc/editor

# or

yarn add @appflowyinc/editor

# or

pnpm add @appflowyinc/editor

Note: This package requires these peer dependencies to be installed:

"peerDependencies": {
    "i18next": "^22.4.10",
    "i18next-resources-to-backend": "^1.2.1",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-i18next": "^14.1.0",
    "slate": "^0.112.0",
    "slate-history": "^0.110.3",
    "slate-react": "^0.112.0"
}

🚀 Quick Start

To use the AppFlowy Web Editor, import the Editor and EditorProvider components from the package and wrap your app

Note: Using the editor requires the EditorProvider component. Therefore, each Editor component needs to be wrapped by the corresponding EditorProvider


import { Editor, EditorProvider } from '@appflowyinc/editor';

const App = () => {
  return <EditorProvider>
    <Editor/>
  </EditorProvider>
};

export default App;

🎨 Custom Toolbar

The AppFlowy Web Editor provides a toolbar with various options for editing content. You can customize the toolbar by passing the ToolbarComponent prop to the Editor component.

import { Editor, EditorProvider, FixedToolbar } from '@appflowyinc/editor';

const App = () => {
  return <EditorProvider>
    <Editor ToolbarComponent={FixedToolbar}/>
  </EditorProvider>;
};

export default App;

📚 Apply Data

You can get editor from the useEditor hook and apply data to the editor.

import { Editor, EditorProvider, useEditor, NodeType } from '@appflowyinc/editor';

const App = () => {
  const editor = useEditor();

  useEffect(() => {
    editor.applyData({
      type: NodeType.Paragraph,
      delta: [
        {
          insert: 'Hello, World!',
        },
      ],
      children: []
    });

    // or apply markdown
    editor.applyMarkdown('# Hello, World!');
  }, []);

  return
  <Editor/>;
};

const Main = () => {
  return <EditorProvider>
    <App/>
  </EditorProvider>;
};

export default App;

💡 Theme Switching

The AppFlowy Web Editor supports theme switching between light and dark modes. You can customize the themes by passing the theme prop to the Editor component.

import { Editor, EditorProvider } from '@appflowyinc/editor';

const App = () => {
  return <EditorProvider>
    <Editor theme={'dark'}/>
  </EditorProvider>;
};

export default App;

🌍 Multi-language Usage

The AppFlowy Web Editor supports multiple languages. You can customize the language by passing the language prop to the Editor component.


import { Editor, EditorProvider } from '@appflowyinc/editor';
// Optionally, you can import the language resources from the package
import zh from '@appflowyinc/editor/locales/zh-CN.json';

import hostI18n from 'i18next';

const App = () => {
  return <I18nextProvider i18n={hostI18n}>
    <EditorProvider>
      <Editor locale={{
        // The language code.
        lang: 'zh-CN',
        // Optionally, you can pass the language resources or let it use the default resources
        resources: zh,
      }}/>
    </EditorProvider>
  </I18nextProvider>;
};

export default App;

Supported Languages

  • English(en)
  • Arabic(ar-SA)
  • Catalan(ca-ES)
  • Central Kurdish(ckb-KU)
  • Czech(cs-CZ)
  • German(de-DE)
  • Spanish(es-VE)
  • Basque(eu-ES)
  • Persian(fa)
  • French(fr-CA)
  • French(fr-FR)
  • Hebrew(he)
  • Hungarian(hu-HU)
  • Indonesian(id-ID)
  • Italian(it-IT)
  • Japanese(ja-JP)
  • Korean(ko-KR)
  • Polish(pl-PL)
  • Brazilian Portuguese(pt-BR)
  • Portuguese(pt-PT)
  • Russian(ru-RU)
  • Swedish(sv-SE)
  • Thai(th-TH)
  • Turkish(tr-TR)
  • Ukrainian(uk-UA)
  • Vietnamese(vi)
  • Vietnamese(vi-VN)
  • Simplified Chinese(zh-CN)
  • Traditional Chinese(zh-TW)

📖 API

Editor Props

| Prop | Type | Default | Description | |------------------|--------------------------------------------------------|-----------|--------------------------------------| | theme | 'light' \| 'dark' | 'light' | Editor theme | | locale | { lang: string; resources?: Record<string, string> } | - | Editor language configuration | | readOnly | boolean | false | Whether the editor is read-only | | onChange | (data: EditorData) => void | - | Callback when editor content changes | | initialValue | EditorData | - | Initial editor content | | modalZIndex | number | 50 | Editor modal z-index | | ToolbarComponent | FC | - | Custom toolbar component |

EditorProvider Props

| Prop | Type | Default | Description | |----------|-------------|---------|-------------------------| | children | ReactNode | - | The children components |

EditorData

type EditorData = {
  type: NodeType;
  data: Record<string, any>;
  delta: DeltaOperation[];
  children: EditorData[];
};

NodeType


enum NodeType {
  Paragraph = 'paragraph',
  Heading = 'heading',
  NestedBlock = 'nested-block',
  Todo = 'todo_list',
  NumberedList = 'numbered_list',
  BulletedList = 'bulleted_list',
  Quote = 'quote',
}

Hooks

useEditor

Returns the editor instance with methods to control the editor.

const editor = useEditor();

| Method | Description | |---------------|------------------------------| | applyData | Apply data to the editor | | applyMarkdown | Apply markdown to the editor |

🔨 Development

Guide

Development Mode


# Install dependencies

pnpm i

# Start development server

pnpm run dev

# Build library

pnpm run build

To run the demo locally:

pnpm install
pnpm run dev

Open http://localhost:5173/ with your browser to see the result. img.png

Switch between light and dark mode by clicking the theme switcher in the top right corner. img_1.png

📄 License

MIT License


[]: # (END) README.md