symfony/ux-twig-component
Symfony UX Twig Components lets you bind PHP objects to Twig templates to build reusable UI pieces like alerts, modals, and sidebars. Create small, composable components with clean rendering and better template organization for Symfony apps.
provide/inject, improved template resolution).provide/inject for state management in nested components (e.g., multi-level forms) to reduce prop drilling.debug:twig-component command and profiler integration simplify debugging.RenderedComponent::crawler()).<twig:ComponentName>) for gradual adoption.Adopt if:
Look elsewhere if:
For Executives: "This package lets us build our UI like Lego blocks—reusable, encapsulated components that reduce code duplication and speed up development. By adopting Symfony’s Twig Components, we can:
For Engineering: "Symfony UX Twig Components give us:
{% include %} with encapsulated components (e.g., {% component 'alert', { type: 'error', message: '...' } %}).provide/inject to avoid prop drilling in nested components (e.g., multi-step forms).debug:twig-component or the profiler, and test them in isolation with built-in helpers.
We’ll start by migrating static components (e.g., cards, modals) and phase in interactive ones. The learning curve is low if you’re familiar with Twig/Stimulus, and Symfony’s backing ensures long-term support."How can I help you explore Laravel packages today?