Render plugins
Render plugins turn HAST nodes into slots. They choose which nodes use each slot and what content to pass along; slot plugins still provide the components.
Declare and use a plugin
This example sends ordinary paragraphs starting with “Note:” to the blockquote slot, leaving other paragraphs unchanged:
match selects nodes, and render passes their content to a slot. renderChildren renders child nodes; current, parents, and render preserve the context the slot needs.
Lower priority values match first. With equal priorities, later render plugins match first, so this custom plugin takes precedence over the preset. Presets continue to handle unmatched nodes.
Import the base class, render types and slot factory from
@fluxdown/react-base-plugins/base. Install it withpnpm add @fluxdown/react-base-plugins.
For component, style, or interaction changes, use a slot plugin. To change HAST content before rendering, use a rehype plugin.