ra-tinymce
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

<TinyMCEEditor /> input component for React-Admin Framework

  • All TinyMCE options are fully supported
  • TypeScript definitions are supported

Binding of <TinyMCEEditor /> for react-admin.

Installation

$ npm install ra-tinymce --save

or

$ yarn add ra-tinymce

Basic usage

import React, { FC } from 'react';
import {
  SimpleForm, 
  Edit,
  TextInput
} from 'react-admin';

import TinyMCEInput, { TinyMCEInputProps } from 'ra-tinymce';

const PostEdit: FC<TinyMCEInputProps> = (props) => {
  return (
    <Edit>
      <SimpleForm>
        <TextInput source="title" />
        <TinyMCEEditor
          source="content"
          init={{
            height: 500,
            menubar: false,
            plugins: [
              'advlist autolink lists link image charmap print preview anchor',
              'searchreplace visualblocks code fullscreen',
              'insertdatetime media table paste code help wordcount'
            ],
            toolbar: 'undo redo | formatselect | ' +
            'bold italic backcolor | alignleft aligncenter ' +
            'alignright alignjustify | bullist numlist outdent indent | ' +
            'removeformat | help',
            content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
          }}
        />
      </SimpleForm>
    </Edit>
  );
};

export default PostEdit;

License

This library is licensed under the MIT Licence.

Author

This library is maintain by @anhquoctran

Package Sidebar

Install

npm i ra-tinymce

Weekly Downloads

3

Version

0.0.2

License

MIT

Unpacked Size

143 kB

Total Files

11

Last publish

Collaborators

  • anhquoc96