How to build a Symfony Live Component with Claude
Quand l'utiliser : You need a reactive form, filter, or list that updates on the server without a full page reload.
Prérequis
- Symfony 6.4+ project with symfony/ux-live-component installed — composer require symfony/ux-live-component
- Skill cloned into ~/.claude/skills/ — git clone https://github.com/smnandre/symfony-ux-skills ~/.claude/skills/symfony-ux-skills
Déroulement
-
Describe the component you needBuild a Live Component for a product search filter with checkboxes for categories and a text query — updates results live as the user types.✓ Copié→ Claude references LiveProp, LiveAction, debounce modifiers from the skill
-
Let Claude scaffold the PHP + TwigGenerate the PHP component class and the Twig template. Use attributes, not annotations.✓ Copié→ File output follows Symfony UX naming (
src/Twig/Components/...) -
Ask Claude to wire the parent pageShow me how to embed this component in an existing Twig page and pass initial state.✓ Copié→ Uses
{{ component() }}helper correctly
Résultat : A working Live Component with proper LiveProp typing and no custom JS.
Pièges
- Claude mixes Live Component and Twig Component concepts — Re-ask naming the package explicitly: 'use symfony/ux-live-component, not twig-component'