Reference
Presets
Load alternate swap rules from a preset map or an external JSON file.
Preset map
Presets let the server choose between several render paths without changing the client code.
{
"fallback": "default",
"presets": {
"default": "#site-main",
"sidebar": "#site-main@innerHTML->#sidebar@innerHTML"
}
}
Header driven
The runtime can read `Recyclr-Use-Presets` and `Recyclr-Event` from the response, which keeps routing logic near the server route that knows the context and lets the server describe alternate swap shapes or follow-up UI events.
Preset triggers can also branch on response status, so `redirect`, `status:200`, and `status:404` can all point at different preset bundles without changing the client selector.
{
"triggers": {
"redirect": ["redirected"],
"status:200": ["default"],
"status:404": ["not-found"]
}
}