How to build a Symfony Live Component with Claude
Wann einsetzen: You need a reactive form, filter, or list that updates on the server without a full page reload.
Voraussetzungen
- 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
Ablauf
-
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.✓ Kopiert→ 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.✓ Kopiert→ 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.✓ Kopiert→ Uses
{{ component() }}helper correctly
Ergebnis: A working Live Component with proper LiveProp typing and no custom JS.
Fallstricke
- Claude mixes Live Component and Twig Component concepts — Re-ask naming the package explicitly: 'use symfony/ux-live-component, not twig-component'