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 20 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
feature #3814 Add support for Twig 4.x ( @Kocal )
Changelog (v3.4.0...v3.5.0)
html_attr() (@Kocal){# inside output expressions with comments (@Amoifr)null as defined (@Kocal)MergeableInterface in ComponentAttributes (@Kocal)html_attr(), so a component and a plain Twig template render attributes identically.
It may break your tests if you assert on the rendered HTML of a component's attributes, since boolean, null, aria-* and non-scalar values now render differently. Re-generate those assertions after upgrading.
null now omits the attribute instead of throwingtrue renders as name=""; for data-* and aria-* attributes it renders name="true"false omits the attribute, except aria-* which now renders name="false" instead of being droppedBackedEnum values are now supportedattributes.render() follows the same rules and returns null for an omitted attribute instead of throwing on a non-string valuetwig/html-extra ^3.29 and twig/twig ^3.24MergeableInterface from twig/html-extra in ComponentAttributes#defaults()<twig:component is="myComponent" ...## <description> documentation comments written above props inside {% props %} (Twig 3.29+), exposed per prop via PropsNode::getPropDocumentation(){% props %} treating a prop explicitly passed as null as missing: a required prop no longer throws, and a prop declaring a default value now keeps the null it was given{# inside a {{ ... }} expression as the start of a Twig comment, which silently stopped every component after it from being rendered{% component %} syntax failing when a prop uses the null-safe operator (?.)feature #3395 Support component tag names from expressions and component objects ( @andreybotanic )
Changelog (v3.3.0...v3.4.0)
{% component %} tag using a
parenthesized expression, e.g. {% component (prefix ~ i) %}{% endcomponent %}Changelog ( v3.2.0...v3.3.0 ) no significant changes
Changelog (v3.2.0...v3.3.0)
feature #3602 Allow standalone usage with any PSR-11 container ( @guillaume-sainthillier )
Changelog (v3.1.0...v3.2.0)
ComponentRendererInterface (@treztreiz)ComponentRendererInterface::preCreateForRender(), ComponentRendererInterface::startEmbeddedComponentRender(), and ComponentRendererInterface::finishEmbeddedComponentRender() methodsComponentFactory and ComponentRuntime with any PSR-11
container, making symfony/dependency-injection optional for standalone usagefeature #3455 Use twig.safe_class tag and move setLexer to TwigComponentPass ( @GromNaN )
Changelog (v3.0.0...v3.1.0)
twig.safe_class tag and move setLexer to TwigComponentPass (@GromNaN)provide() and inject() Twig functions (@Kocal)provide() and inject() Twig functions to share state from a parent
component down to deeply-nested descendants without prop drillingnullfeature #3040 Remove deprecations ( @smnandre )
Changelog (v2.34.0...v3.0.0)
AttributeValueInterface from twig/html-extra:^3.24.0 in ComponentAttributes (@Kocal)twig_component.defaults could not be nullable anymorePreCreateForRenderEvent::getProps() in favor of PreCreateForRenderEvent::getInputProps()cva Twig function in favor of html_cva Twig function from twig/html-extranull as an attribute value when using ComponentAttributes (or attributes Twig variable) will now throw an exception, use remove() insteadComponentAttributes::add(), use {{ attributes.defaults(stimulus_controller('...')) }} insteadComponentTemplateFinder does not accept Twig\Environment as first argument anymore, pass a LoaderInterface insteadComponentTemplateFinder does not accept a nullable directory argument anymore, pass a string insteadStimulusTwigExtension from WebpackEncoreBundle ^1.0, use StimulusBundle insteadChangelog ( v2.35.0...v2.36.0 )
Changelog (v2.35.0...v2.36.0)
Changelog ( v2.34.0...v2.35.0 )
Changelog (v2.34.0...v2.35.0)
Changelog ( v2.33.0...v2.34.0 )
Changelog (v2.33.0...v2.34.0)
Changelog ( v2.32.0...v2.33.0 )
Changelog (v2.32.0...v2.33.0)
PropertyAccessor::isWritable() calls (@Kocal){ props } (@Kocal)Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
- Add Symfony 8 support
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fix ComponentAttributes rendering when using StimulusAttributes as default attributes
ComponentAttributes rendering when using StimulusAttributes as default attributes[SECURITY] ComponentAttributes now requires a Twig\Runtime\EscaperRuntime instance as second argument
ComponentAttributes now requires a Twig\Runtime\EscaperRuntime
instance as second argumentHtmlAttributeEscaperInterface, TwigHtmlAttributeEscaper and ComponentAttributesFactoryDeprecate not passing an HtmlAttributeEscaperInterface to the ComponentAttributes constructor
ComponentAttributes responsible for attribute escaping ensuring
consistent and secure HTML output across all rendering contextsHtmlAttributeEscaperInterface to the ComponentAttributes
constructorNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Deprecate cva Twig function in favor of `html_cva` from `twig/html-extra` #2144
cva Twig function in favor of html_cva from twig/html-extra #2144Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add nested attribute support #1405
Introduce CVA to style TwigComponent #1416
Add the ability to render specific attributes from the attributes variable #1442
attributes variable #1442Nothing published for this version
Fix various usages of deprecated Twig code
ComponentAttributes traversable/countable{# twig comments #} with HTML Twig syntaxNothing published for this version
Nothing published for this version
Deprecate calling ComponentTemplateFinder constructor without directory argument.
PreMountEvent and PostMountEventouterScope variable reach variables from the parent template of an
"embedded" component.ComponentTemplateFinder constructor without directory argument.TwigComponentDataCollector and debug toolbar templatesdebug:twig-component command.{% component %}/<twig:component> syntaxes are
rendered vs component(): PostRenderEvent is now dispatched & the template
resolution happens at runtime.Fixed deprecation with TemplateCacheWarmer return type.
debug:twig-component command.TemplateCacheWarmer return type.Nothing published for this version
Nothing published for this version
Support ...spread operator with html syntax (requires Twig 3.7.0 or higher)
RenderedComponent::crawler() and toString() methods.outerBlocks.<twig:component> syntax where an attribute is set to an empty value.Nothing published for this version
Nothing published for this version
Nothing published for this version
The ComponentAttributes::defaults() method now accepts any iterable argument. The ComponentAttributes::add() method has been deprecated. To add a Stim…
ComponentAttributes::defaults() method now accepts any iterable argument.
The ComponentAttributes::add() method has been deprecated. To add a Stimulus
controller to the attributes, use {{ attributes.defaults(stimulus_controller('...')) }}.Nothing published for this version
Add new HTML syntax for rendering components:
<twig:ComponentName>true attribute values now render just the attribute name, false excludes it entirely.AsTwigComponent is now optional and defaults to the class name.ComponentFactory methods.Nothing published for this version
PreMount and PostMount hooks can now return nothing.
PreMount and PostMount hooks can now return nothing.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →