Core@knitui/graphics
GraphicsProvider
Initializes the Skia graphics runtime. On native it's a pass-through (Skia is linked into the app); on web it loads the CanvasKit WASM blob and renders fallback until it's ready, exposing the state via useGraphicsReady(). Wrap your app once, near the root — every graphics component must render beneath it on web. (Storybook already wraps all stories in one, so this is just for illustration.)
WebiOSAndroid3 own props1 examples
import { GraphicsProvider } from "@knitui/graphics";Playground
Loading playground…
<GraphicsProvider />Examples
Usage
Loading example…
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | |
fallback | ReactNode | — | Rendered on web while the CanvasKit WASM runtime is loading. Defaults to `null`. Ignored on native, where the runtime is ready synchronously. |
locateFile | ((file: string) => string) | undefined | — | Override how CanvasKit WASM asset URLs are resolved on web. By default the wasm is loaded from the jsDelivr CDN, matching the installed `@shopify/react-native-skia` `canvaskit-wasm` version. Ignored on native. |