UIPluginProvider
UIPluginProvider(
props):Element
Defined in: packages/ui/src/plugin.tsx:66
React context provider that makes a UIPlugin available to all @cfast/ui components.
Place this near the root of your component tree (typically in the root layout). All headless components use useComponent internally to resolve their styled implementations from this context.
Parameters
Section titled “Parameters”Component props.
children
Section titled “children”ReactNode
Child elements that can access the plugin via useUIPlugin or useComponent.
plugin
Section titled “plugin”The UI plugin created by createUIPlugin.
Returns
Section titled “Returns”Element
A React element wrapping children with the UI plugin context.
Example
Section titled “Example”import { UIPluginProvider, createUIPlugin } from "@cfast/ui";
const plugin = createUIPlugin({ components: { button: MyButton } });
function Root() { return ( <UIPluginProvider plugin={plugin}> <App /> </UIPluginProvider> );}