Skip to content

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.

Component props.

ReactNode

Child elements that can access the plugin via useUIPlugin or useComponent.

UIPlugin

The UI plugin created by createUIPlugin.

Element

A React element wrapping children with the UI plugin context.

import { UIPluginProvider, createUIPlugin } from "@cfast/ui";
const plugin = createUIPlugin({ components: { button: MyButton } });
function Root() {
return (
<UIPluginProvider plugin={plugin}>
<App />
</UIPluginProvider>
);
}