-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Overview
Introduce a template system to store and reuse generated UIs. Currently, when an AI generates a UI from data (e.g., Invoice JSON → Invoice UI), there's no way to save that layout and style for future use. This feature would enable users to capture a "liked" UI structure and apply it to similar data.
Use Case
Invoice Example:
- User provides invoice JSON data
- AI generates a beautiful Invoice UI with specific styling and layout
- User likes the design and wants to reuse this style for all future invoices
- Instead of regenerating from scratch each time, use the saved template
- Templates can be modified/tweaked for different invoice types
Goals
- Save generated UI structures as reusable templates
- Store templates in a schema format (JSON, Zod, or similar)
- Apply templates to new data with the same structure
- Modify/customize templates without affecting the original
- Version and manage multiple template variants
Implementation Considerations
-
Schema Definition: Define a schema to represent UI templates
- Component types and props
- Layout structure
- Styling information
- Data bindings/mappings
-
Template Storage: Where and how to persist templates
- Database/file storage
- User-owned vs. shared templates
- Template versioning
-
Template Application: How to apply templates to new data
- Schema matching/validation
- Partial template application
- Override/customize specific sections
-
Integration with Generative UI: How templates interact with the generative UI system
- Use templates as "style guides" for generation
- Save newly generated UIs as templates
- Mix template-based and AI-generated components
Example Data Structure
interface UITemplate {
id: string;
name: string;
description: string;
schema: Zod.ZodSchema | JSONSchema;
components: Component[];
styling: Record<string, any>;
createdAt: Date;
updatedAt: Date;
version: number;
}
interface Component {
type: string;
props: Record<string, any>;
dataBinding?: string;
children?: Component[];
}Next Steps
- Define the template schema format
- Design the template storage/management layer
- Build template application engine
- Create UI for saving/managing templates
- Integrate with existing generative UI system
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request