Slot plugins
Slot plugins render components. Content such as code, links and headings is already prepared; you choose its presentation and interactions.
Declare and use a plugin
This example hides the code toolbar while keeping the default highlighting and code styles. Save it in a .tsx module:
Then pass it to the component:
Import the plugin base class and slot prop types from
@fluxdown/solid-plugins/base.splitPropscomes fromsolid-js, andDynamicfromsolid-js/web.
key identifies the plugin, type selects a slot, and Component supplies a Solid component. Use signals, effects and cleanup inside it as you would in any Solid component. Keep changing props reactive with props.field or splitProps.
Keep the default behavior
Raw is the component supplied by the previous plugin. Render it to preserve existing highlighting or layout, then override individual props to change part of its behavior.
At the same priority, later plugins for a slot wrap earlier components through Raw. Return your own JSX to replace it entirely. Slots with child content receive it through props.children.
Rawcan benull. PassingRaw ?? undefinedtoDynamicrenders nothing when there is no previous component.
Choose a slot
Each slot has its own prop type, such as LinkProps or HeadingProps. Use Render plugins to change which slot handles a HAST node.