Yoyo Component Generator
Generate Yoyo PHP component boilerplate instantly. Configure properties, actions, events, computed properties, and lifecycle hooks with live code preview.
- Free, no sign-up
- REST + MCP
- Updated
- Reviewed by Olgun Ozoktas
Presets
Basic Settings
Public Properties
Action Methods
Computed Properties
Event Listeners
Lifecycle Hooks
PHP Class
<?php
namespace App\Yoyo;
use Clickfwd\Yoyo\Component;
class MyComponent extends Component
{
}Template (PHP)
<div>
<div yoyo:spinning>
Loading...
</div>
</div>How to Generate a Yoyo Component
-
Set Component Name
Enter your component name in PascalCase and set the namespace. -
Choose Template Engine
Select PHP, Blade, or Twig as your template engine. -
Add Properties
Define public properties with their types and default values. -
Configure Actions
Add action methods that handle user interactions. -
Copy or Download
Copy the generated code or download both files as a ZIP archive.
Who Uses This Tool?
PHP Developers
Teams Adopting Yoyo
Rapid Prototyping
Why Use the Yoyo Component Generator?
The Yoyo Component Generator creates ready-to-use PHP component files for the Yoyo reactive framework. Configure properties, actions, computed properties, event listeners, and lifecycle hooks through an interactive form, then copy or download the generated code.
Yoyo brings reactive, server-rendered components to any PHP project without requiring a specific framework. It uses htmx under the hood, making it lightweight and efficient.
How it compares
Unlike manually writing Yoyo components from scratch, this generator ensures correct syntax, proper namespace usage, and includes all the necessary boilerplate. It supports all three template engines (PHP, Blade, Twig) and includes preset examples for common patterns.
Tips for Yoyo Components
- Always wrap your template in a single root element (required by Yoyo).
- Use $props to persist properties across component updates.
- Use $queryString to sync component state with the URL for bookmarkable pages.
- Computed properties are cached per request - use them for expensive calculations.
- Use yoyo:spinning to show loading indicators during server requests.