API reference · React editor bridge
@oriatheme/react-editor
React session Provider, subscription, and auto-preview coordination for a local source ThemeEditor; it exports no visible UI.Package and environment
React 18.2 or 19 client bridge; use a locally CLI-installed ThemeEditor as the visible root.
bash
pnpm add @oriatheme/editor-core @oriatheme/react-editorbash
npm install @oriatheme/editor-core @oriatheme/react-editorbash
yarn add @oriatheme/editor-core @oriatheme/react-editorbash
bun add @oriatheme/editor-core @oriatheme/react-editorUse the package manager and lockfile already chosen by the consumer project. Examples use package-root exports only; do not deep-import from src, dist, or registry templates.
Exports
| Export | Signature | Description |
|---|---|---|
ThemeEditorProvider | ({ session?, options?, children }) => ReactElement | Provides a caller session or owns one for the subtree. |
useThemeEditor | () => { session, snapshot } | Subscribes directly to editor-core immutable state. |
useThemeEditorAutoPreview | (runtime?, mode?) => ThemeEditorAutoPreviewState | Coalesces valid revisions per animation frame. |
re-exported editor-core types | ThemeEditorOptions, ThemeEditorSession, … | Convenience type/domain re-exports; behavior remains in editor-core. |
tsx
import { ThemeEditorProvider, useThemeEditorAutoPreview } from "@oriatheme/react-editor";
function Bridge({ runtime }: { runtime: OriaThemeRuntime }) {
const preview = useThemeEditorAutoPreview(runtime);
return <span>{preview.status}</span>;
}Visible UI lives in your project
This package exports no Toolbar, Tabs, fields, or CSS. Use the CLI to copy components into components/oria-theme-editor, then let routes compose only the local ThemeEditor, runtime, and options.