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

editor-react-quill

v1.2.25

Published

react quill

Readme

editor-react-quill

一个基于quill 的 react组件 Editor

  • 使用 npm i editor-react-quillyarn add editor-react-quill

  • // 在React 项目中快速使用
    import { Editor } from 'editor-react-quill'
    const show = (content: string, textLen: number, imgsLen: number) => {
        console.log(content, textLen, imgsLen)
    }
    function Demo() {
        // onChange为必传参数
        return <div>
            <Editor onChange={show}/> 
        </div>
    }
  • API

    | Name | Description | Type | Default | | :---------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------------------- | | onChange | 实时获取编辑器的内容content,以及内容的文字长度textLen,图片数量imgsLen | (content: string, textLen: number, imgsLen: number) => void | - | | onError | 用于接收图片格式错误msg的提示 | (msg: string) => void | - | | placeholder | 编辑器的placeholder | string | '请在这里输入内容' | | clearable | 是否开启清空按钮 | boolean | false | | theme | 主题theme | 'snow'丨'bubble' | 'snow' | | clipboard | 是否过滤剪切板的内容为纯文字 | boolean | true | | toolBar | 是否开启toolBar, 默认关闭false, 也可自定义 | any[][]丨boolean | false | | upload | 在打开toolbar 的 image 的基础上,是否自定义上传图片的函数 | (file: File) => Promise<string丨{status: number, target: string}> | - | | maxLength | 文字最大长度 | number | 1000 | | maxImages | 图片最大数量 | number | 6 |

  • toolBar 常用配置

    更多配置

    toolBar={[
        ['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线
        ['blockquote', 'code-block'], // 引用,代码块
        [{ header: 1 }, { header: 2 }], // 标题,键值对的形式;1、2表示字体大小
        [{ list: 'ordered' }, { list: 'bullet' }], // 列表
        [{ script: 'sub' }, { script: 'super' }], // 上下标
        [{ indent: '-1' }, { indent: '+1' }], // 缩进
        [{ direction: 'rtl' }], // 文本方向
        [{ size: ['small', false, 'large', 'huge'] }], // 字体大小
        [{ header: [1, 2, 3, 4, 5, 6, false] }], // 几级标题
        [{ color: [] }, { background: [] }], // 字体颜色,字体背景颜色
        [{ font: [] }], // 字体
        [{ align: [] }], // 对齐方式
        ['clean'], // 清除字体样式
        ['image'] // 上传图片
    ]}
  • 注意

    // 如果想自定义上传图片的方法请同时传入toolBar和upload
    <Editor 
        onChange={show} 
        upload={yourFunc} 
        toolBar={[['image']]} 
    />