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

simple-rich-text-editor

v1.2.1

Published

a rich text editor for react

Downloads

15

Readme

Simple Rich Text Editor

A simple text input for react applications which can change your input text into bold, italic, ~~strikethrough~~ , and more. This package wouldn't been possible to make without @tiptap/react

Installation

Install Simple Rich Text Editor with npm

  npm i simple-rich-text-editor

Usage

  import { useState } from "react";
  import { RichTextEditor } from "simple-rich-text-editor";
  import "./App.css";


  export default function App() {
  const [data, setData] = useState("");
  return (
       <div>
       <RichTextEditor onchange={(data) => setData(data)} editorClass="card" />
       </div>
  )
}

API

| Property | Type | Description | | ------------------- | ------------------------ | ----------------------------------------------- | | boldIcon | React.ReactNode | Icon for the bold formatting | | italicIcon | React.ReactNode | Icon for italic formatting | | strikethroughIcon | React.ReactNode | Icon for strikethrough formatting | | codeIcon | React.ReactNode | Icon for code formatting | | heading1Icon | React.ReactNode | Icon for heading level 1 formatting | | heading2Icon | React.ReactNode | Icon for heading level 2 formatting | | heading3Icon | React.ReactNode | Icon for heading level 3 formatting | | bulletListIcon | React.ReactNode | Icon for bullet list formatting | | orderedListIcon | React.ReactNode | Icon for ordered list formatting | | codeBlockIcon | React.ReactNode | Icon for code block formatting | | blockquoteIcon | React.ReactNode | Icon for blockquote formatting | | undoIcon | React.ReactNode | Icon for undo action | | redoIcon | React.ReactNode | Icon for redo action | | showBold | boolean | Show/hide the bold formatting option | | showItalic | boolean | Show/hide the italic formatting option | | showStrikethrough | boolean | Show/hide the strikethrough formatting option | | showCode | boolean | Show/hide the code formatting option | | showHeading1 | boolean | Show/hide the heading level 1 formatting option | | showHeading2 | boolean | Show/hide the heading level 2 formatting option | | showHeading3 | boolean | Show/hide the heading level 3 formatting option | | showBulletList | boolean | Show/hide the bullet list formatting option | | showOrderedList | boolean | Show/hide the ordered list formatting option | | showCodeBlock | boolean | Show/hide the code block formatting option | | showBlockquote | boolean | Show/hide the blockquote formatting option | | showUndoIcon | boolean | Show/hide the undo action icon | | showRedoIcon | boolean | Show/hide the redo action icon | | onchange | (text: string) => void | Callback function triggered on text change | | editorClass | string | Custom CSS style for the text input | | buttonStyle | string | Custom CSS style for the editor buttons |

Troubleshooting

If you're facing any issues while enabling setting showCodeBlock = true, showBlockquote = true you can customize its appearance by adding the following CSS styles to your main CSS file:

Example

.tiptap pre {
  background-color: #0d0d0d;
  color: #fff;
  font-family: "JetBrainsMono", monospace;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
}

.tiptap pre code {
  color: inherit;
  padding: 0;
  background: none;
  font-size: 0.8rem;
}

.tiptap blockquote {
  padding-left: 1rem;
  border-left: 2px solid rgba(13, 13, 13, 0.1);
}