OriaTheme
GitHub

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-editor

Use 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

ExportSignatureDescription
ThemeEditorProvider({ session?, options?, children }) => ReactElementProvides a caller session or owns one for the subtree.
useThemeEditor() => { session, snapshot }Subscribes directly to editor-core immutable state.
useThemeEditorAutoPreview(runtime?, mode?) => ThemeEditorAutoPreviewStateCoalesces valid revisions per animation frame.
re-exported editor-core typesThemeEditorOptions, 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.