Beyond HTML: Colocating Assets in Twig Components
Twig Components have made it easier than ever to build reusable UI components in Symfony. But while templates are often nicely organized, their CSS, JavaScript, images, and other assets usually end up somewhere else.
What if every component could own everything it needs?
In this talk, we'll explore an approach that keeps templates and their assets together, making components easier to understand, reuse, and maintain. While this architecture fits naturally with Atomic Design, it works equally well for any component-based Symfony application.
To demonstrate the concept, I'll introduce AtomicAssetsBundle, an open-source bundle that automatically discovers and bundles assets alongside your Twig components. Along the way, we'll discuss the challenges of component-scoped assets, how this approach integrates into existing Symfony projects, and the trade-offs of keeping everything in one place.
Whether you're building a design system or simply want a cleaner way to organize your frontend code, you'll leave with practical ideas for creating truly self-contained Symfony components.
Friday, November 27, 2026 at 14:30 PM – 15:05 PM