Skip to content

Rich Text Control

RichText control allow user add WYSIWYG editor to Chai Builder block settings panel.

Usage

import { RichText, registerChaiBlock } from "@chaibuilder/blocks";
const YourBlock = ({ content }) => {
return <div dangerouslySetInnerHTML={{ __html: content }} />
}
registerChaiBlock(YourBlock, {
type: 'YourBlock',
label: 'Your Block',
category: 'Basic',
props: {
content: RichText({ title: "Content", default: "<p>Default content</p><h1>Heading</h1>" })
}
})

Arguments

  • default - Default value for control.
  • title - Title of control visible in Chai Builder block settings panel
  • placeholder - Placeholder text for control
  • binding - Binding flag for control. Default value is true. If false then control will not be visible in binding panel.