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

@mithya-team/rte-quill-plugin

v0.0.3

Published

`rte-quill-plugin` is a plugin for integrating Quill rich text editor with your form library. It provides an easy-to-use interface for creating rich text content within forms handled by popular form libraries like React Hook Form, Formik, or Redux Form.

Downloads

1

Readme

rte-quill-plugin

rte-quill-plugin is a plugin for integrating Quill rich text editor with your form library. It provides an easy-to-use interface for creating rich text content within forms handled by popular form libraries like React Hook Form, Formik, or Redux Form.

Features

  • Rich Text Editing: Utilize the full power of Quill's rich text editing.
  • Form Library Integration: Seamlessly integrates with your form library for easy data handling.
  • Customizable Toolbars: Configure toolbars to include only the options you need.
  • Image and Color Support: Support for custom image uploads and a color picker.
  • Responsive and Adaptive: Works across different devices and screen sizes.

Description

The rte-quill-plugin provides a simple way to include rich text editing in your forms. Whether you're building a blog, a CMS, or any application requiring formatted text input, this plugin is designed to be a drop-in solution that integrates Quill editor with your form library, ensuring that text data is easily captured and managed within your form's state.

Installation

Install the package via npm or yarn:

npm install @mithya-team/rte-quill-plugin

or

yarn add @mithya-team/rte-quill-plugin

Usage

To use the plugin, import it in your form component and use it as a controlled component:

import React, { useState } from "react";
import { useForm } from "react-hook-form";
import RTEQuill from "@mithya-team/rte-quill-plugin";

const MyForm = () => {
  const [content, setContent] = useState("");
  const { handleSubmit, control } = useForm();

  const onSubmit = (data) => console.log(data);

  return (
    <form onSubmit={handleSubmit(onSubmit)}>
      <RTEQuill value={content} onChange={setContent} name="content" />
      <input type="submit" />
    </form>
  );
};

Props

Below are the properties you can pass to RteQuill component:

  • name (string): Identifies the field in a form. It's important for handling form data and linking the label to the editor.
  • label (string): Text displayed above the editor as a label.
  • helperText (string): Additional guidance or information displayed below the editor.
  • sizes (QuillFontSizeOption[]): Defines the font size options available in the editor. Each option should have a label (string) for display and a value (string) representing the font size.
  • customImageUploadAdapter (function): A function that handles image uploading. It takes a File object as input and returns a Promise that resolves to the image URL.
  • toolbarProps (object): Properties for customizing the editor's toolbar. Note that "customSizes" and "id" are omitted from this object.
  • errorText (string): Text to display any error or validation message related to the editor.

Ensure to spread the field object from react-hook-form's Controller render prop to RteQuill to fully integrate with form handling.

Example usage in Controller:

<Controller
  name="rteEditor"
  control={control}
  render={({ field }) => <RteQuill {...dummyRteQuillProps} {...field} />}
/>

Checkout the playground code for implementation

Issues and Pull Requests

Contributions are always welcome! If you encounter any issues or would like to contribute, please file an issue or submit a PR:

Issues: GitHub Issues Pull Requests: GitHub Pull Requests