@rhc-shared-components/rich-text-editor
TypeScript icon, indicating that this package has built-in type declarations

0.6.5 • Public • Published

@rhc-shared-components/rich-text-editor

WYSWYG Editor for Red Hat Certified Apps

NPM JavaScript Style Guide

Install

yarn add @rhc-shared-components/rich-text-editor

Usage

import React from 'react';
import { RichTextEditorFormComponent, RichTextEditor } from '@rhc-shared-components/rich-text-editor';
import { Formik } from 'formik';
import { Title } from "@patternfly/react-core";

const App = () => {
  const FieldName = 'richtext';
  return (
    <div>
      <Title headingLevel={'h1'}>RichTextEditor</Title>
      <RichTextEditor value={"<h3>hello world from normal RTE</h3>"}/>
      <Title headingLevel={'h1'}>RichTextEditor with formik</Title>
      <Formik
        initialValues={{
          [FieldName]: '<h1>Hello world</h1>'
        }}
        enableReinitialize={true}
        onSubmit={()=>{}}>
        <RichTextEditorFormComponent
          name={FieldName}
          label={'Rich text form label'}
          helperText={'This is a test description'}
          isRequired={true}
        />
      </Formik>
    </div>);
}

License

MIT © gautamkrishnar

/@rhc-shared-components/rich-text-editor/

    Package Sidebar

    Install

    npm i @rhc-shared-components/rich-text-editor

    Weekly Downloads

    2

    Version

    0.6.5

    License

    MIT

    Unpacked Size

    35.4 kB

    Total Files

    11

    Last publish

    Collaborators

    • eyevana
    • kipatil-1
    • shkale
    • bdone
    • gkr-redhat