---
title: "Yoyo Component Generator"
description: "Generate Yoyo PHP component boilerplate instantly. Configure properties, actions, events, computed properties, and lifecycle hooks with live code preview."
url: https://findutils.com/developers/yoyo-component-generator/
category: developers
---

# Yoyo Component Generator

Generate Yoyo PHP component boilerplate instantly. Configure properties, actions, events, computed properties, and lifecycle hooks with live code preview.

**Use this tool:** [Yoyo Component Generator](https://findutils.com/developers/yoyo-component-generator/)

## Programmatic access

- REST id `yoyo-component-generator`: POST https://api.findutils.com/api/tools/yoyo-component-generator/execute (reference: https://findutils.com/api/yoyo-component-generator/)
- MCP tool `yoyo_component_generator` on https://mcp.findutils.com (reference: https://findutils.com/mcp/yoyo-component-generator/)

## Why Use the Yoyo Component Generator?

Creating Yoyo components involves writing PHP classes with the correct namespace, extending Component, setting up properties, lifecycle hooks, and matching template files. This generator eliminates the boilerplate, letting you focus on your component logic instead of scaffolding.

## 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.

## Frequently Asked Questions

### What is Yoyo PHP?

Yoyo is a framework-agnostic PHP library for building reactive, dynamic interfaces using server-rendered HTML. It works with any PHP project and uses htmx under the hood for AJAX transport.

### Do I need Laravel to use Yoyo?

No. Yoyo is framework-agnostic and works with vanilla PHP, Laravel, Symfony, and any other PHP framework. It supports PHP, Blade (without Laravel), and Twig template engines.

### What are Yoyo computed properties?

Computed properties are defined using the getXxxProperty() naming convention. They allow you to derive values from component state and are accessible in templates using the snake_case version of the property name.

### What is the difference between dynamic and anonymous components?

Dynamic components have a PHP class and a template file. Anonymous components are template-only, with no backing PHP class. Anonymous components are simpler but have fewer features.

### What does the $props property do in Yoyo?

The protected $props array specifies which public properties should persist across component updates. Without $props, property values may reset on each server request.

### Does the Yoyo Component Generator require a signup?

No. It is available with no signup and no usage limits. The PHP boilerplate is generated in your browser.

### Which template engines can the component use?

Plain PHP, Blade, and Twig. Choose the engine in the second step and the generated view file matches its syntax.

### What does $queryString do?

It syncs the listed component properties with the URL query string, so a filtered or paginated component state can be bookmarked and shared.

## Related Tools

- [Yoyo Config Generator](https://findutils.com/developers/yoyo-config-generator/)
- [Yoyo Loading State Builder](https://findutils.com/developers/yoyo-loading-state-builder/)
- [Robots.txt Generator](https://findutils.com/seo/robots-txt-generator/)
- [Meta Tag Generator](https://findutils.com/seo/meta-tag-generator/)
- [JSON-LD Generator](https://findutils.com/seo/json-ld-generator/)
