Cookbook / Context Provider

Context Provider

container

provide() intrinsic — exposes a theme token to descendant consumers over the context prototype chain.

id
context-provider
since
0.5.0
file
context-provider.aihu
stateprovideactionslotinterpolation

Run it

source · static

This recipe doesn't have a hydrated island in the demo gallery yet. An in-browser, WASM-compiled playground (edit this source and re-render live) is planned as a follow-up — read the real source below.

Source

context-provider.aihu

Requires

concerns
state

Anti-patterns

  • provide() must run during setup — do not call it inside onMount; descendants connecting during mount would miss the scope.

Related recipes