Slot plugins
Slot plugins render slots. Content such as code, links, and headings is already prepared; you decide which components and interactions readers see. Start here for most interface changes.
Declare and use a plugin
This example hides the code toolbar while keeping the default highlighting and code styles:
key identifies the plugin, type selects the slot, and Component provides its component. Add the plugin class to slots; Fluxdown manages its creation and cleanup.
Import base classes and prop types from
@fluxdown/react-presets/base. Install the extension package withpnpm add @fluxdown/react-presetsfirst.
Keep the defaults
Raw is the component supplied by the previous plugin. Call it to keep the existing highlighting, copying, or link behavior, then adjust the props you want to change.
Several plugins can target the same slot. Later plugins wrap earlier components through Raw. To replace a slot entirely, return your own JSX.
Rawcan benull; check it before rendering.
Choose a slot
Each slot has a corresponding prop type, such as LinkProps or HeadingProps.
To change which slot a HAST node uses, continue with Render plugins.
Built-in plugins
Fluxdown includes these plugins by default; no additional setup is needed.
These plugins are included in PRESET_SLOT_PLUGINS and exported from @fluxdown/react-presets/slot.
The formula presets are included, but formula syntax still needs
build={{ tex: true }}.