New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-enhanced-text-editor

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-enhanced-text-editor

A simple and customizable rich text editor built with React.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
1
Maintainers
0
Weekly downloads
 
Created
Source

React Enhanced Text Editor

A simple and customizable rich text editor built with React. This editor supports various text formatting options and media embedding, making it suitable for a wide range of applications.

Table of Contents

  • Features
  • Installation
  • Usage
  • Customization
  • Development
  • Build
  • Contributing
  • License

Features

  • Text Formatting: Supports headings, paragraphs, bold, italic, font size, and font family.
  • Lists: Create ordered and unordered lists.
  • Text Alignment: Align text to the left, center, or right.
  • Indentation: Increase or decrease text indentation.
  • Spacing: Adjust line spacing and text spacing.
  • Undo/Redo: Easily revert or reapply changes.
  • Customizable: Style the editor and toolbar to fit your application's design.

Installation

To install the package, run:

npm install react-enhanced-text-editor

Usage

To use the rich text editor in your application, import the Editor and Toolbar components:

import React, { useState } from 'react';
import { Editor, Toolbar } from 'react-enhanced-text-editor';

const App: React.FC = () => {
  const [content, setContent] = useState<string>('');
  const [isRaw, setIsRaw] = useState<boolean>(false);

  const handleContentChange = (newContent: string) => {
    setContent(newContent);
  };

  const handleFormat = (command: string, value?: string) => {
    document.execCommand(command, false, value);
  };

  const toggleRaw = () => {
    setIsRaw(!isRaw);
  };

  return (
    <div className="app">
      <Toolbar onFormat={handleFormat} toggleRaw={toggleRaw} isRaw={isRaw} />
      <Editor content={content} onChange={handleContentChange} isRaw={isRaw} />
    </div>
  );
};

export default App;

Example screenshot

React Enhanced Text Editor

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Keywords

react

FAQs

Package last updated on 24 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts