Generative UI with Lyra Gen
Model answers and live dashboards wey show as real, checked Lyra controls.
Lyra Gen de turn model structured answer to accessible Lyra components through catalog wey dem don review. Content wey e generate fit only call catalog roles, never any random tag, script or action; your application still hold di model request, data, actions and storage. Live dashboards de bind your data, queries, rows wey repeat, values wey dem calculate and condition for wetin go show, and each update de repaint only di panels wey e touch. Inspector, mock data, telemetry and lyra-gen init starter go help you build without backend or model.
Try one request
- Show me my monthly spending
- Why chop for outside high like dis?
- Set limit for chop for outside
- Warn me before I spend pass
- Compare am wit last year
- Wetin grow pass?
- Show how di rest of di year go be
- Where I fit save money?
- Cancel di ones wey I no dey use
- Set savings target
- Why chop for outside high like dis?
- How my shop dey do?
- Where people dey comot?
- Bring back carts wey people leave
- Phone vs computer
- Which countries dey grow?
- Zoom enter di country wey dey grow fastest
- Plan launch for new country
- Wetin dey sell pass?
- Restock di best sellers
- Join di top two as bundle
- Where people dey comot?
- Wen my café dey busy pass?
- Na only Saturday
- Add second barista for di busy time
- Compare am wit Sunday
- Compare am wit last month
- Why Tuesday drop?
- Show di last 6 months
- Wen my workers no dey enough?
- Plan next week workers
- I suppose open early?
- Na only Saturday
Example
Pick one reviewed catalog subset, then check generated view before you render am.
import '@aceshooting/lyra-ui/theme.css';
import { initialCatalog, subsetCatalog } from '@aceshooting/lyra-gen/catalog.js';
import { validateView } from '@aceshooting/lyra-gen/runtime.js';
import { LyraGenViewElement } from '@aceshooting/lyra-gen/gen-view.js';
const selected = subsetCatalog(initialCatalog, ['stack', 'heading', 'text']);
if (!selected.ok) throw new Error('The requested catalog is unavailable.');
const catalog = selected.value;
const result = validateView({
version: '1', catalog: { id: catalog.id, version: catalog.version },
surfaceId: 'answer-1', revision: 0,
root: { id: 'summary', type: 'stack', children: [
{ id: 'title', type: 'heading', text: 'Quarterly summary' },
{ id: 'detail', type: 'text', text: 'Revenue increased this quarter.' },
] },
}, catalog);
if (!result.ok) throw new Error('The generated view was rejected.');
const view = new LyraGenViewElement();
view.catalog = catalog;
view.document = result.value;
document.body.append(view);