LARC Playground
Interactive component explorer and testing tool for the LARC framework.
Features
- Component Palette: Browse 49+ components organized by category
- Live Preview: See components render in real-time
- Properties Panel: Edit component attributes dynamically
- Code Export: Generate clean HTML from your designs
- PAN Bus Monitor: Visualize message flow between components
- Zero Build: Runs directly in the browser, no compilation needed
Quick Start
Local Development
git clone https://github.com/larcjs/larc.git
cd larc/playground
# Using Python
python3 -m http.server 8080
# Using Node.js http-server
npx http-server -p 8080
# Using PHP
php -S localhost:8080
Online Demo
Visit the live playground at: https://larcjs.com/playground/
Usage
Component Categories
- ๐งญ Routing & Navigation - Client-side routing
- ๐พ State Management - Data persistence and state
- ๐ Forms & Input - Form handling and validation
- ๐ Data & Connectivity - API integration and data fetching
- ๐จ UI Components - Interface building blocks
- ๐ Content & Media - Content display and editing
- ๐ Authentication - Security and auth
- ๐ญ Theming - Theme management
- ๐ง Developer Tools - Debugging utilities
- โ๏ธ Advanced - Advanced functionality
Architecture
playground/
โโโ index.html # Main page
โโโ playground.mjs # Entry point
โโโ component-registry.json # Component metadata
โโโ components/ # Playground components
โ โโโ pg-palette.mjs # Component browser
โ โโโ pg-canvas.mjs # Live preview
โ โโโ pg-properties.mjs # Property editor
โ โโโ pg-exporter.mjs # Code generator
โ โโโ pg-bus-monitor.mjs # Message visualizer
โโโ styles/
โ โโโ playground.css # Styling
โโโ scripts/
โโโ generate-registry.mjs # Registry generator
Regenerating Component Registry
The component registry is auto-generated from component source files:
node scripts/generate-registry.mjs
This scans all components in ../components/ and extracts:
- Component names and descriptions
- Attributes from
observedAttributes - Categories and icons
- Metadata for the playground
Development
Adding New Components
/components/node scripts/generate-registry.mjsgenerate-registry.mjs if neededCustomizing Categories
Edit CATEGORIES and COMPONENT_CATEGORIES in scripts/generate-registry.mjs:
const CATEGORIES = [
{ id: 'custom', name: 'Custom Components', icon: 'โจ' }
];
const COMPONENT_CATEGORIES = {
'my-component': 'custom'
};
Browser Support
- Chrome/Edge 90+
- Firefox 90+
- Safari 14+
License
MIT
Related Packages
- @larcjs/core - Core PAN bus implementation
- @larcjs/ui - Component library
- @larcjs/core-types - TypeScript types
- @larcjs/ui-types - Component types