vanilla
Drop-in integration
Add one script tag, use the global `Recyclr` object, and start with navigation before expanding outward to forms, sidebars, or modals.
Go Green
RGX is a drop-in runtime for server-rendered websites. It keeps state, redirects, templates, and defaults on the server while the browser handles navigation, multi-target partial swaps, loading states, and realtime updates.
No Stimulus required. Use window.Recyclr or window.GX and start with navigation before expanding outward.
Why teams pick RGX
Use RGX when you want the browser to stay thin, the server to stay authoritative, and the page to keep its structure even as the content changes.
Install and adopt
The cleanest adoption path starts with navigation, then expands into forms, sidebars, and modals once the team sees the pattern working.
Expose the global bundle and call window.Recyclr.mount(document) at boot. The runtime can live alongside existing markup without a framework rewrite.
Use short selectors like #site-main or #site-nav. Keep fallback links and forms valid, then let RGX upgrade them when JavaScript is available.
Use templates, preset bundles, and a request-scoped view model to keep the browser logic tiny and let one response coordinate several DOM updates.
Go Green
Let Blade, Go templates, or your server renderer own the shell, empty states, redirects, and shared request state. RGX can swap nav, content, alerts, and modal shells in one request, with preset bundles and response headers keeping the server in control.
data-gx-select="#site-nav@outerHTML->#site-nav@outerHTML #site-main@outerHTML->#site-main@outerHTML #modal-root@innerHTML->#modal-root@innerHTML"
Recyclr-Use-Presets: dashboard modal
Recyclr-Event: updated
Documentation
Interactive
Calculator, fake IM, modal, error message, JSON formatter, and regex tester demos with RGX trigger HTML and matching server handlers.
Frequently asked
RGX is a fragment-first runtime for server-rendered HTML. It keeps the server in charge of state, redirects, and templates while the browser handles navigation, partial swaps, and realtime updates.
No. `window.Recyclr.mount(document)` is enough to wire up navigation, forms, and other delegated interactions. Stimulus remains optional as an adapter for teams that already use it.
Return a normal HTTP redirect with a `Location` header. RGX follows the final URL, so auth gates and route decisions stay on the server.
Yes. Start with one shell, usually navigation or a main content region, then expand into forms, modals, sidebars, and realtime updates as your team is ready.
Yes. A single response can target multiple DOM regions, and preset bundles plus response headers let the server choose the swap shape and follow-up event without chaining extra requests.
Yes. RGX works well for dashboards that need frequent updates across multiple regions, like counters, tables, badges, alerts, and side panels. A single response can keep those pieces in sync without chained requests or a complicated client-side architecture.