@glyphjs/runtime
React rendering engine for Glyph JS IR documents.
Install
pnpm add @glyphjs/runtime react react-dom
Usage
import { createGlyphRuntime } from '@glyphjs/runtime';
import { compile } from '@glyphjs/compiler';
const runtime = createGlyphRuntime();
const { ir } = compile(markdown);
function App() {
return <runtime.Document ir={ir} />;
}
Theming
import { ThemeProvider, darkTheme } from '@glyphjs/runtime';
function App() {
return (
<ThemeProvider theme={darkTheme}>
<runtime.Document ir={ir} />
</ThemeProvider>
);
}
Key exports
createGlyphRuntime()-- create a runtime instance with aDocumentcomponentGlyphDocument-- standalone document rendererBlockRenderer-- renders individual IR blocksThemeProvider/useGlyphTheme-- theme system with light and dark presetsLayoutProvider/DocumentLayout/DashboardLayout/PresentationLayout-- layout enginesComponentRegistry/PluginRegistry-- component registration and plugin systemErrorBoundary/FallbackRenderer-- graceful error handlingRuntimeProvider/useRuntime/useReferences-- React context and hooks