Home / playground / README

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

  • Clone the repository:
  • git clone https://github.com/larcjs/larc.git
       cd larc/playground
  • Serve with any static file server:
  • # Using Python
       python3 -m http.server 8080
    
       # Using Node.js http-server
       npx http-server -p 8080
    
       # Using PHP
       php -S localhost:8080
  • Open http://localhost:8080 in your browser
  • Online Demo

    Visit the live playground at: https://larcjs.com/playground/

    Usage

  • Browse Components: Use the left sidebar to explore available components by category
  • Search: Type in the search box to filter components by name or description
  • Add to Canvas: Click any component to add it to the canvas
  • Edit Properties: Select a component to see and edit its attributes in the right panel
  • View Code: Click "View Code" to see the generated HTML
  • Monitor Messages: Click "PAN Monitor" to watch PAN bus messages
  • 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

  • Add your component to /components/
  • Regenerate the registry: node scripts/generate-registry.mjs
  • Add category mapping in generate-registry.mjs if needed
  • Optionally add an icon mapping
  • Customizing 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+
    Requires ES modules and Custom Elements support.

    License

    MIT

    Related Packages