Design-system & provider integration for React apps.
A view provider is any component that must wrap the whole application tree (SSR and CSR):
a design-system theme provider (MUI, Chakra, Mantine…), an i18n provider, a
store provider, etc. Tailwind / plain-CSS design systems need none of this — they are just a
stylesheet import handled by the CLI's Vite pipeline.
There are two ways to register a provider; both feed the SAME blueprint key
(stone.useReact.providers), which the CLI assembles at build time and buildAppComponent
composes around the app root (outermost-first by ascending priority).
The app's blueprint is produced by the CLI, which runs every blueprint config and blueprint
middleware. A defineBlueprintConfig block therefore runs at build time; blueprint.add
appends to the providers list:
2. Declarative — @ViewProvider (best for app-authored provider components)
Decorate a React component class; the CLI's SetReactViewProvidersMiddleware discovers it
among the build's modules and adds it to the same list — no blueprint code needed:
Design-system & provider integration for React apps.
A view provider is any component that must wrap the whole application tree (SSR and CSR): a design-system theme provider (MUI, Chakra, Mantine…), an i18n provider, a store provider, etc. Tailwind / plain-CSS design systems need none of this — they are just a stylesheet import handled by the CLI's Vite pipeline.
There are two ways to register a provider; both feed the SAME blueprint key (
stone.useReact.providers), which the CLI assembles at build time andbuildAppComponentcomposes around the app root (outermost-first by ascendingpriority).1. Imperative —
defineViewProvider(best for library components & DI-aware factories)The app's blueprint is produced by the CLI, which runs every blueprint config and blueprint middleware. A
defineBlueprintConfigblock therefore runs at build time;blueprint.addappends to the providers list:For a DI-aware provider, register a factory (it receives the container at compose time):
2. Declarative —
@ViewProvider(best for app-authored provider components)Decorate a React component class; the CLI's
SetReactViewProvidersMiddlewarediscovers it among the build's modules and adds it to the same list — no blueprint code needed:Both approaches are interchangeable and can be mixed; ordering is always by
priority.