JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 313
  • Score
    100M100P100Q105567F
  • License MIT

Summernote lite without bootstrap for react (Super simple WYSIWYG editor)

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-summernote-lite) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    react-summernote-lite

    Summernote lite without bootstrap for react with fast setup

    npm version

    Getting Started

    Install

    react-summernote-lite is built upon jquery

    npm install react-summernote-lite jquery --save

    or using yarn

    yarn add react-summernote-lite jquery

    No additional setup needed

    Example

    import SummernoteLite from "react-summernote-lite";
    
    // you need to iport the css style yourself
    import 'react-summernote-lite/dist/summernote-lite.min.css';
    
    // only import if you want to add some languages
    import 'react-summernote-lite/dist/lang/summernote-zh-CN.min';
    
    // only import if you want to add some fonts
    import 'react-summernote-lite/dist/font/summernote.ttf';
    
    const App = () => {
      const [imageFiles, setImageFiles] = useState([]);
    
      const noteRef = useRef();
    
      return (
        <div>
        <SummernoteLite
          ref={noteRef}
          defaultCodeValue={'<p>This is the default html value</p>'}
          placeholder={"Write something here..."}
          tabsize={2}
          lang="zh-CN" // only if you want to change the default language
          height={350 || "50vh"}
          dialogsInBody={true}
          blockquoteBreakingLevel={0}
          toolbar={[
            ['style', ['style']],
            ['font', ['bold', 'underline', 'clear', 'strikethrough', 'superscript', 'subscript']],
            ['fontsize', ['fontsize']],
            ['fontname', ['fontname']],
            ['color', ['color']],
            ['para', ['ul', 'ol', 'paragraph']],
            ['table', ['table']],
            ['insert', ['link', 'picture', 'video', 'hr']],
            ['view', ['fullscreen', 'codeview', 'help']]
          ]}
          fontNames={[
            "Arial",
            "Georgia",
            "Verdana",
            "e.t.c..."
          ]}
          callbacks={
            onImageUpload: function (files){
                setImageFiles(files);
            },
            onKeyup: function (e){},
            onKeyDown: function (e){},
            onPaste: function (e){}
          }
        />
    
        <button
            style={{ marginTop: 9 }}
            onClick={() => {
                noteRef.current.summernote('fullscreen.toggle');
            }}>
            Fullscreen
        </button>
        </div>
      );
    };
    
    export default App;
    

    PropTypes

    Property Type Description
    defaultCodeValue string The default html value of summernote
    callbacks Object Keys that emits event Callbacks
    useDiv boolean By default summernote is mounted using