1.0.12 • Published 2 years ago

preact-wysiwyg-editor v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Preact WYSIWYG Editor

A simple WYSIWYG (What You See Is What You Get) editor component for Preact, supporting basic text formatting options: bold, italic, and underline. This lightweight editor is perfect for applications that require basic text editing capabilities without the overhead of more complex libraries.

How to Install

To install the preact-wysiwyg-editor, run the following command in your project directory:

npm install preact-wysiwyg-editor

How to use

CommonJS (CJS) and ES Modules (ESM) support is available. To use the preact-wysiwyg-editor in your Preact application, follow these steps:

  1. Import the WysiwygEditor component from the package.
import WysiwygEditor from 'preact-wysiwyg-editor';
  1. Add the WysiwygEditor component to your component's render method or return statement.
import WysiwygEditor from 'preact-wysiwyg-editor';

const App = () => {
  const [value, onChange] = useState('');

  return (
    <div>
      <WysiwygEditor value={value} onChange={onChange} />
      <div>
        <h2>Editor Content:</h2>
        <div dangerouslySetInnerHTML={{ __html: value }} />
      </div>
    </div>
  );
};

export default App;

Playground in Preact environment

https://codepen.io/dannyb9737/pen/vYqOrpq

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago