live-component

Build interactive server-rendered Symfony UX components with LiveProp and LiveAction.

166|12|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/smnandre/symfony-ux-skills --skill live-component
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: live-component
Source: https://github.com/smnandre/symfony-ux-skills/tree/main/skills/live-component
Command: npx skills add https://github.com/smnandre/symfony-ux-skills --skill live-component

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Symfony UX LiveComponent provides a way to build interactive, server-rendered components in PHP and Twig, enabling real-time UI updates without writing client-side JavaScript.

Core Features & Use Cases

  • Server-rendered reactivity: components re-render via AJAX as users interact with the UI.
  • Rich prop/action model: supports LiveProp, LiveAction, data-model bindings, forms, and component communication.
  • Real-world scenarios include live search, dynamic forms, modal dialogs, and live lists that morph as data changes.

Quick Start

Define a class annotated with AsLiveComponent, declare LiveProp and LiveAction properties, and render the root element with {{ attributes }} to enable reactivity.

Frequently Asked Questions about live-component

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build reactive server-rendered UI components in Symfony without writing JavaScript?

Reactive server-rendered UI components in Symfony are built using the UX LiveComponent library with PHP and Twig. Components re-render via AJAX as users interact, requiring an AsLiveComponent class annotation and a root template element rendered with attributes to enable reactivity.

How does data-binding work with Twig templates for live search and dynamic forms?

Data-binding in Twig templates uses the data-model attribute to link HTML inputs directly to LiveProp properties. When users interact with elements like a live search field, the component re-renders via AJAX, automatically updating the server-rendered UI without client-side JavaScript.

Do I need client-side JavaScript to update Symfony components dynamically on input?

You do not need client-side JavaScript to update Symfony components dynamically. The LiveComponent system handles AJAX requests automatically when users interact with the UI, re-rendering the server-rendered Twig templates on the server and morphing the DOM upon response.

What are the requirements to set up a Symfony UX LiveComponent with LiveProp and LiveAction?

Setting up a Symfony UX LiveComponent requires defining a PHP class annotated with AsLiveComponent, declaring LiveProp and LiveAction properties, and rendering the root element with attributes. This strict structure ensures the server-rendered component functions and re-renders correctly.

Can I create modal dialogs and live lists that morph as data changes using server-rendered PHP?

You can create modal dialogs and live lists that morph as data changes using server-rendered PHP. By applying the LiveComponent architecture with LiveAction methods and data-model bindings, dynamic UI elements re-render seamlessly via AJAX as underlying data updates.

Why are my Symfony UX LiveComponent updates not working when re-rendering the template?

LiveComponent updates fail when the root template element lacks the required attributes variable or the PHP class misses the AsLiveComponent annotation. Proper data-model bindings and LiveProp declarations are strictly enforced to ensure the AJAX re-rendering mechanism functions correctly.