The html
field represents a chunk of HTML content.
interface HtmlConfig {
component: 'html'
name: string
label?: string
description?: string
}
Option | Description |
---|---|
component | The name of the plugin component. Always 'html' . |
name | The path to some value in the data being edited. |
label | A human readable label for the field. Defaults to the name . (Optional) |
description | Description that expands on the purpose of the field or prompts a specific action. (Optional) |
This interfaces only shows the keys unique to the html field.
Visit the Field Config docs for a complete list of options.
The html
field plugin is not a default plugin. In order to use it in your site you must install the react-tinacms-editor
package:
yarn add react-tinacms-editor
You can then add it to your cms:
import { HtmlFieldPlugin } from 'react-tinacms-editor'
cms.plugins.add(HtmlFieldPlugin)
Visit the plugins doc to learn how to reduce your initial bundle size by dynamically loading & registering the plugins.
Below is an example of how a html
field could be defined. Read more on passing in form field options.
const BlogPostForm = {
fields: [
{
name: 'frontmatter.summary',
component: 'html',
label: 'Summary',
},
// ...
],
}