WIDGET BUILDER GUIDE
Ecosistema completo para organización y gestión de contenido con interfaces espaciales
🚀 Widget Builder Guide
Overview
The Widget Builder is a powerful, AI-enhanced tool for creating custom widgets in GoGrab Space. It provides three distinct creation modes to accommodate different workflows and skill levels.
Creation Modes
1. 🤖 AI Generate Mode
The fastest way to create widgets. Simply describe what you want in plain English and let AI generate the code.
How to use:
- Select "AI Generate" from the creation mode selector
- Type a description of your widget (e.g., "Create a modern contact form with name, email, and message fields")
- Click "Generate with AI"
- Review and customize the generated widget
- Save
Example prompts:
- "Create a pricing card with plan name, price, and feature list"
- "Build a user profile card with avatar, name, and stats"
- "Design a subscription toggle with monthly/yearly pricing"
- "Make a search bar with autocomplete suggestions"
AI generates:
- Widget name and description
- HTML template (Angular syntax)
- SCSS styles (using theme variables)
- TypeScript logic
- Property definitions
- Event definitions
2. 📦 From Component Mode
Start from an existing embeddable component and customize its properties.
How to use:
- Select "From Component" from the creation mode selector
- Browse the component palette
- Select a base component
- Configure properties using the visual editor
- Give your widget a name and description
- Save
Benefits:
- Start with tested, accessible components
- Visual property configuration
- Automatic type handling
- Immediate preview
3. 💻 Custom Code Mode
Full control with HTML, CSS, and TypeScript editors.
How to use:
- Select "Custom Code" from the creation mode selector
- Optionally select a starting variant
- Write or paste your code
- Preview in real-time
- Save
Best for:
- Experienced developers
- Complex custom logic
- Migrating existing components
- Full creative control
Property Types
The Widget Builder supports these property types:
| Type | UI Control | Example |
|---|---|---|
string |
Text input | Labels, placeholders |
number |
Number input | Sizes, counts |
boolean |
Toggle switch | Enabled/disabled states |
select |
Dropdown | Predefined options |
color |
Color picker | Theme colors |
object |
JSON editor | Complex configuration |
Variant Management
Variants allow you to create different configurations of the same widget.
Creating Variants
- Save your base widget first
- Go to the "Variants" tab
- Click "Add Variant"
- Configure:
- Name: Descriptive name (e.g., "Primary Button", "Dark Theme")
- Description: What makes this variant unique
- Properties: Override specific properties
Using Variants
Variants are automatically available in:
- Widget palette (drag & drop)
- Component library
- Code completion
Best Practices
1. Use Theme Variables
Always use CSS variables from the theme system:
// ✅ Good
background: var(--ux-surface);
color: var(--ux-text-primary);
border-radius: var(--ux-radius-lg);
// ❌ Bad
background: #1e293b;
color: #f1f5f9;
2. Make Components Accessible
- Add
aria-attributes - Ensure keyboard navigation
- Provide proper labels
- Use semantic HTML
3. Keep Templates Clean
Use Angular control flow syntax:
<!-- ✅ Good -->
@if (isLoading()) {
<div class="loader">Loading...</div>
}
@for (item of items(); track item.id) {
<div>{{ item.name }}</div>
}
<!-- ❌ Bad -->
<div *ngIf="isLoading()" class="loader">Loading...</div>
4. Define Clear Properties
Each property should have:
- Descriptive name
- Clear type
- Sensible default
- Description for users
Integration with Module System
Widgets created in the Widget Builder are automatically registered with the EmbeddableRegistryService, making them available:
- In the visual editor - Drag & drop onto canvas
- In modules - Reference in module manifests
- In code - Import and use programmatically
Example: Using in a Module
const manifest: ModuleManifest = {
id: 'my-module',
name: 'My Module',
embeddableComponents: [
{
id: 'custom-contact-form', // Your widget ID
// ... widget config
}
]
};
Troubleshooting
AI Generation Issues
Problem: AI service unavailable Solution:
- Check backend API is running on port 3000
- Verify network connectivity
- Try a simpler prompt
Problem: Generated code has errors Solution:
- Review and fix manually in code tab
- Try rephrasing your prompt with more detail
- Use the "Start Over" button
Preview Not Working
Problem: Preview is blank Solution:
- Ensure template has valid HTML
- Check for JavaScript errors in console
- Verify component imports are correct
Variants Not Saving
Problem: Variants don't appear after save Solution:
- Ensure base widget is saved first
- Check network connectivity
- Verify backend sync status
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl/Cmd + S |
Save widget |
Ctrl/Cmd + Enter |
Generate with AI |
Escape |
Close modal |
Tab |
Navigate form fields |
Related Documentation
Last Updated: December 4, 2025