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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-vditor

v0.2.1

Published

Vditor in React

Downloads

30

Readme

react-vditor

version download cnpmVersion cnpmDownload FOSSA Status

English | 简体中文

Vditor Components for React!

About Vditor, see Vanessa219/vditor

Usage

  • Add dependencies
npm install vditor react-vditor
# or
yarn add vditor react-vditor
# or
pnpm install vditor react-vditor
  • Import component
import React, { FC, useState, useEffect } from "react"
import Vditor from "vditor"
import { VditorEditor } from "react-vditor"

const TestVditorEditor: FC = () => {
    const [vditor, setVditor] = useState<Vditor>()
    useEffect(() => {
        if (!!vditor) {
            console.log(`Update Default Vditor:`)
            console.log(vditor)
        }
    }, [vditor])
    return <VditorEditor keyID="base-editor" bindVditor={setVditor} />
}

export default TestVditorEditor

see demo for more

What is react-vditor?

react-vditor is a wrapper of Vditor. Due to the reason that the Vditor is independent of frameworks, and we always need to initialize the Vditor in the lifecycle! Repeated operations are always boring! Thus, react-vditor provides some components for React that cover commonly used Vditor editors, makes it easy to use in React.

What's more, the react-vditor is well compatible with Vditor and provides some custom props for better development experience.

Vditor Components of react-vditor

| components | description | | ------------------------- | :----------------------------------- | | <VditorEditor /> | Basic Vditor editor | | <VditorIREditor /> | Vditor IR editor (Syntax Sugar) | | <VditorSVEditor /> | Vditor SV editor (Syntax Sugar) | | <VditorWYSIWYGEditor /> | Vditor WYSIWYG editor (Syntax Sugar) | | <VditorPreview /> | Vditor markdown preview component |

Props of Vditor Components

| props | type | required | description | | ---------- | ------------------------------------------ | -------- | :---------------------------- | | keyID | string | √ | ID of editor | | options | IOptions | × | Vditor options | | bindVditor | (vditor: Vditor): void | × | Bind Vditor instance to state |

  • Props of VditorPreview

| props | type | required | description | | ----------- | ------------------------------------------------- | -------- | :----------------------------- | | markdown | string | √ | markdown content | | options | IPreviewOptions | × | Vditor preview options | | customClass | string | × | custom preview component class |

Development

  • The project packages are managed by pnpm
npm install -g pnpm

pnpm install

# for dev
pnpm dev

# for build
pnpm build
  • Preivew Changes
cd __test__

pnpm install

pnpm link ..

License

MIT © Herbert He

FOSSA Status