NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist, #529 most downloaded on Packagist
Twig components for Symfony
Latest stable
v3.7.0
Last release 14 days ago
03 Nov 2026
Ships fairly regularly
a new release about every 3 weeks
Some releases are documented
notes for 31 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
65 releases · first in 2021
Drag across the ruler to compare, or tap a release to open it.
Allow to pass stringable object as non mapped component attribute.
ExposeInTemplate to be used on public component methods.Nothing published for this version
Make public component properties available directly in the template ({{ prop }} vs {{ this.prop }}).
Make public component properties available directly in the template ({{ prop }} vs {{ this.prop }}).
Add PreMount priority parameter.
Add PostMount hook component hook to intercept extra props.
Add attributes system that takes extra props passed to component() and converts them
into a ComponentAttributes object available in your template as attributes.
Add PreRenderEvent to intercept/manipulate twig template/variables before rendering.
Add ExposeInTemplate attribute to make non-public properties available in component
templates directly.
Add Computed Properties system.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
Support for stimulus version 2 was removed and support for @hotwired/stimulus version 3 was added. See the @symfony/stimulus-bridge CHANGELOG for more
Support for stimulus version 2 was removed and support for @hotwired/stimulus
version 3 was added. See the @symfony/stimulus-bridge CHANGELOG
for more details.
Minimum PHP version was bumped to 8.0 so that PHP 8 attributes could be used.
The ComponentInterface was dropped and replaced by the AsTwigComponent attribute.
The getComponentName() was replaced by a name argument to the attribute.
Before:
use Symfony\UX\TwigComponent\ComponentInterface;
class AlertComponent implements ComponentInterface
{
public string $type = 'success';
public string $message;
public static function getComponentName(): string
{
return 'alert';
}
}
After:
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;
#[AsTwigComponent('alert')]
class AlertComponent
{
public string $type = 'success';
public string $message;
}
If you're using a version lower than Symfony 5.3, you will need
to manually tag all component services with twig.component. This is
because Symfony 5.3 introduces autoconfiguration for PHP 8 attributes,
which this library leverages.
The template for a component can now be controlled via the template argument
to the AsTwigComponent attribute:
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;
#[AsTwigComponent('alert', template: 'other/path/alert.html.twig')]
class AlertComponent
{
// ...
}
One column per quarter.