1.0.1 • Published 7 months ago

abhee-rich-text-editor v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

abhee-rich-text-editor

A beautiful and feature-rich text editor for React applications with parameter suggestions.

Features

  • Rich text formatting (bold, italic, underline)
  • Headings (H1, H2)
  • Lists (ordered and unordered)
  • Todo lists with checkboxes
  • Image insertion
  • Table creation
  • Parameter suggestions with @ symbol
  • Fully customizable

Installation

npm install abhee-rich-text-editor

Usage

import { RichTextEditor } from 'abhee-rich-text-editor';

function App() {
  const handleChange = (content: string) => {
    console.log('Editor content:', content);
  };

  const customParameters = [
    {
      id: '1',
      name: 'userName',
      description: 'User\'s full name'
    },
    // Add more parameters as needed
  ];

  return (
    <RichTextEditor
      initialContent="<p>Start typing here...</p>"
      parameters={customParameters}
      onChange={handleChange}
      minHeight="300px"
    />
  );
}

Props

PropTypeDefaultDescription
initialContentstring''Initial HTML content
minHeightstring'200px'Minimum height of editor
parametersParameter[]...Custom parameters for suggestions
onChange(content: string) => voidundefinedCallback when content changes
classNamestring''Additional CSS classes

Parameter Suggestions

Type '@' in the editor to trigger parameter suggestions. Select a parameter to insert it with curly braces (e.g., {userName}).

License

MIT