Neopolitan Pizza Maker

    react-tinacms-editor
    TypeScript icon, indicating that this package has built-in type declarations

    0.53.19 • Public • Published

    react-tinacms-editor

    This package provides a WYSIWYM Editor for HTML and Markdown.

    Install

    yarn add react-tinacms-editor
    

    Field Plugins

    This package provides two field plugins for TinaCMS: MarkdownFieldPlugin and HtmlFieldPlugin.

    Registering the new Field Plugins

    in your _app.{js,tsx}

    <TinaCMS
        apiURL={...}
        
        cmsCallback={(cms) => {
          import("react-tinacms-editor").then(({ MarkdownFieldPlugin }) => {
            cms.plugins.add(MarkdownFieldPlugin);
          });
          // or
          import("react-tinacms-editor").then(({ HtmlFieldPlugin }) => {
            cms.plugins.add(HtmlFieldPlugin);
          });
          //...
        }}
       //... 

    Using in a form

    And then in your schema.ts file you can use these in the ui.component portion of a field

    {
      type: 'string',
      label: 'mainContent',
      name: 'body',
      // isBody is used to tell the backend to write this to the body of the markdown or MDX file.
      isBody: true
      ui: {
        component: "markdown",
      }
    },

    Or for the html plugin

    {
      type: 'string',
      label: 'mainContent',
      name: 'body',
      // isBody is used to tell the backend to write this to the body of the markdown or MDX file.
      isBody: true
      ui: {
        component: "html",
      }
    },

    Keywords

    none

    Install

    npm i react-tinacms-editor

    DownloadsWeekly Downloads

    3,628

    Version

    0.53.19

    License

    Apache-2.0

    Unpacked Size

    519 kB

    Total Files

    146

    Last publish

    Collaborators

    • kldavis4
    • spbyrne
    • jamespohalloran
    • scottgallant
    • tinacmsbot
    • forestry_chris
    • jeffsee55
    • dwalkr