wc-wysiwyg
v0.0.5
Published
A web component WYSIWYG text editor built on document.designMode and document.execCommand
Downloads
6
Maintainers
Readme
ALPHA: WC-WYSIWYG
WYSIWYG Text editor built with a Custom Element
This package is still in alpha.
Installation
Using npm:
$ npm install wc-wysiwyg
Then with a module bundler like webpack, use as you would anything else:
// using ES6 modules
import 'wc-wysiwyg';
This will automatically register the custom element <wc-wysiwyg>
ready for you to use.
Usage
In your HTML, add the element <wc-wysiwyg>
, and you’re good to go
<!DOCTYPE html>
<html lang="en">
<body>
<wc-wysiwyg>
<script type="text/javascript" src="wc-wysiwyg.min.js"></script>
</body>
</html>
Shortcuts
| Command | Keys |
| ------- | ---- |
| Bold | Cmd
+ b
| Italic | Cmd
+ i
| Underline | Cmd
+ u
| Align Left | Cmd
+ Shift
+ l
| Align Center | Cmd
+ Shift
+ c
| Align Right | Cmd
+ Shift
+ r
| Indent | Tab
| Outdent | Shift
+ Tab
Simple mode
This mode only shows Bold, Italic and Underline controls.
<wc-wysiwyg simple>
Issues
If you find a bug, please file an issue on the issue tracker on GitHub.
Credits
Web Components Text WYSIWYG is built and maintained by Tristan Matthias.