Generative Collection Display
AI-native collection display using json-render-svelte for dynamic, spec-driven layouts.
On this page
The Generative Collection Display renders a collection’s data using a dynamic JSON specification powered by json-render-svelte. It enables AI-generated, interactive layouts that leverage existing widgets from the svelty component registry.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
schema |
Schema |
required | Collection schema with optional displaySpec field |
entries |
CollectionEntry[] |
required | Collection entries to display |
context |
Record<string, unknown> |
{} |
Additional context passed to the renderer |
Architecture
The component works in three layers:
- Schema Layer: The collection
Schemamay include adisplaySpecfield — a JSON object conforming to thejson-render-svelteSpecinterface - Registry Layer:
sveltyRegistryfrom@src/services/json-render/catalogmaps component names (e.g.,"EntryList") to actual Svelte components - Renderer Layer:
JSONUIProviderandRendererfromjson-render-svelteconsume the spec + registry to produce the UI
Fallback Behavior
If schema.displaySpec is not defined, the component falls back to a default render spec that wraps entries in a basic EntryList component, ensuring the display always works even without AI-generated layouts.
Usage
<GenerativeCollectionDisplay {schema} {entries} />
Related
Was this page helpful?