@olwiba/genesis-render
v0.0.11
Published
olwibaUI adapter layer for @json-render — JSON-to-UI rendering for Genesis projects
Readme
What This Is
@olwiba/genesis-render is the @olwiba/ui adapter for @json-render/react.
It lets you describe UI declaratively as a JSON spec and renders it using the full Olwiba component library. Useful for AI-generated pages, dynamic dashboard layouts, or any surface where structure comes from data rather than code.
Installation
bun add @olwiba/genesis-renderPeer dependencies: @olwiba/cn, @olwiba/ui, react, react-dom, zod
import { GenesisPage } from '@olwiba/genesis-render';
const spec = {
root: 'header-1',
elements: {
'header-1': {
type: 'PageHeader',
props: { title: 'Dashboard', description: 'Welcome back' },
children: ['card-1'],
},
'card-1': {
type: 'StatCard',
props: { label: 'Users', value: '1,234', delta: '+12%', trend: 'up' },
children: [],
},
},
};
function DashboardPage() {
return (
<GenesisPage
spec={spec}
onAction={{ navigate: (p) => router.navigate(p.to) }}
/>
);
}What's Included
GenesisPage Top-level renderer — pass a spec and action handlers, get a full page
defineRegistry Cherry-pick specific components for a lean custom renderer
catalog Full component registry with Zod-validated prop schemas
AI prompting catalog.prompt() generates a system prompt describing all registered components
Ecosystem
- @olwiba/ui — the component library being rendered
- @olwiba/cn — base UI primitives
- genesis — the baseline template
Contributing
Bug reports, pull requests & feature requests are welcome. Open an issue first for anything beyond a small fix.
