@glyphjs/runtime
v0.6.0
Published
React-based rendering runtime for Glyph JS IR
Downloads
594
Maintainers
Readme
@glyphjs/runtime
React rendering engine for Glyph JS IR documents.
Install
pnpm add @glyphjs/runtime react react-domUsage
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
Docs
https://github.com/VledicFranco/glyphjs
