diff --git a/.changeset/two-lions-guess.md b/.changeset/two-lions-guess.md index 0c82c1f..7174a88 100644 --- a/.changeset/two-lions-guess.md +++ b/.changeset/two-lions-guess.md @@ -2,4 +2,4 @@ '@graphcms/rich-text-html-renderer': minor --- -export elements functions +Export `defaultElements` diff --git a/packages/html-renderer/README.md b/packages/html-renderer/README.md index c3434a8..93b76a7 100644 --- a/packages/html-renderer/README.md +++ b/packages/html-renderer/README.md @@ -67,6 +67,26 @@ const html = astToHtmlString({ }); ``` +If needed, you can also import the `defaultElements` from the package and use it as a base for your custom renderers. + +```js +import { + astToHtmlString, + defaultElements, +} from '@graphcms/rich-text-html-renderer'; + +const content = { + /* ... */ +}; + +const html = astToHtmlString({ + content: inlineContent, + renderers: { + bold: props => defaultElements.bold(props), + }, +}); +``` + Below you can check the full list of elements you can customize, alongside the props available for each of them. - `a`