NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #522 most downloaded on Packagist
Twig components for Symfony
Last release 18 days ago
18 Sep 2026
Ships fairly regularly
a new release about every 3 weeks
Some releases are documented
notes for 26 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
63 releases · first in 2021
One column per quarter.
Nothing published for this version
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
{
// ...
}
Your coding agent can read these notes before it upgrades. Set up the MCP server →