Documentation Index
Fetch the complete documentation index at: https://docs.weaverse.io/llms.txt
Use this file to discover all available pages before exploring further.
Creating Components
This guide walks you through creating Weaverse components from scratch, covering everything from basic component structure to advanced patterns with TypeScript and React 19.Component Structure
Every Weaverse component follows this structure:Required Exports
Each component file must export:- Default export - The React component
- schema export - Component configuration
- loader export (optional) - Server-side data loading
Basic Component Example
Here’s a simple component following modern React 19 patterns:Component Registration
IMPORTANT: After creating your component, you must register it in the components file to make it available in Weaverse Studio.Registration Steps
- Import your component in the components file:
- Restart your development server to see the component in Weaverse Studio:
Registration Example from Pilot Template
Here’s how components are registered in the official Pilot template:Common Registration Issues
Problem: Component doesn’t appear in Weaverse Studio after creation* as
Schema Definition
The schema defines how your component appears and behaves in Weaverse Studio:Basic Schema Structure
Input Types
Weaverse supports various input types:TypeScript Integration
Component Props Interface
Always define proper TypeScript interfaces:Schema Type Safety
You can extract types from your schema:Data Loading
For components that need server-side data, export a loader function:Styling Patterns
Tailwind CSS Integration
Use Tailwind classes for styling:Class Variance Authority (CVA)
For complex component variants:Best Practices
1. Component Organization
2. Error Boundaries
3. Loading States
4. Responsive Design
Advanced Patterns
Context Providers
Compound Components
Schema Composition
Next Steps
- Learn about Input Settings
- Master Component Schemas
- Explore Data Fetching
- Review Styling & Theming