NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #513 most downloaded on Packagist
Twig components for Symfony
Latest stable
v3.7.0
Last release 19 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.
feature #4207 Add a shorthand for dynamic props named like a variable (@Kocal)
Changelog (https://github.com/symfony/ux-twig-component/compare/v3.6.0...v3.7.0)
data-model listeners for other components (@Kocal).gitignore, and ignore the .vitest/ report directory (@Kocal){% block %}, {% endblock %} and {% embed %} inside a component (whitespace control, extra or missing spaces, named {% endblock name %})<twig:Alert :message /> as a shorthand for :message="message" when the prop name matches the variable nameYour coding agent can read these notes before it upgrades. Set up the MCP server →
bug #4080 Fix the pre-lexer mistaking <twig: inside a { } tag for a component (@javiereguiluz)
Changelog (https://github.com/symfony/ux-twig-component/compare/v3.5.0...v3.6.0)
<twig: inside a { } tag for a component (@javiereguiluz)PreRenderEvent (@Kocal)<twig: written inside a {% %} tag for a component (for example in the ## ... documentation of a prop, in a # inline comment or in a string)Nothing published for this version
feature #3814 Add support for Twig 4.x (@Kocal)
Changelog (https://github.com/symfony/ux-twig-component/compare/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 (https://github.com/symfony/ux-twig-component/compare/v3.3.0...v3.4.0)
{% component %} tag using a
parenthesized expression, e.g. {% component (prefix ~ i) %}{% endcomponent %}Changelog (https://github.com/symfony/ux-twig-component/compare/v3.2.0...v3.3.0) * no significant changes
Changelog (https://github.com/symfony/ux-twig-component/compare/v3.2.0...v3.3.0)
feature #3602 Allow standalone usage with any PSR-11 container (@guillaume-sainthillier)
Changelog (https://github.com/symfony/ux-twig-component/compare/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 (https://github.com/symfony/ux-twig-component/compare/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 (https://github.com/symfony/ux-twig-component/compare/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 (https://github.com/symfony/ux-twig-component/compare/v2.35.0...v2.36.0) * no significant changes
Changelog (https://github.com/symfony/ux-twig-component/compare/v2.35.0...v2.36.0)
feature #3407 Allow Symfony UX 3.x packages (@Kocal)
Changelog (https://github.com/symfony/ux-twig-component/compare/v2.34.0...v2.35.0)
AttributeValueInterface from twig/html-extra:^3.24.0 in ComponentAttributes (@Kocal)AttributeValueInterface from twig/html-extra:^3.24.0 in ComponentAttributesChangelog (https://github.com/symfony/ux-twig-component/compare/v2.33.0...v2.34.0) * no significant changes
Changelog (https://github.com/symfony/ux-twig-component/compare/v2.33.0...v2.34.0)
bug #3372 Fix reflection issues for private properties from trait and parent class (@kachnitel)
Changelog (https://github.com/symfony/ux-twig-component/compare/v2.32.0...v2.33.0)
PropertyAccessor::isWritable() calls (@Kocal){ props } (@Kocal)index.html.twig template fallback when resolving namespaced anonymous componentsAsTwigComponent(template: FromMethod('getCustomFuntion'))Add option profiler.collect_components to control component data collection in the profiler (enabled in debug mode by default)
profiler.collect_components to control component data collection
in the profiler (enabled in debug mode by default)Nothing published for this version
Ensure compatibility with PHP 8.5
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
[BC BREAK] The PreRenderEvent namespace was changed from Symfony\UX\TwigComponent\EventListener to Symfony\UX\TwigComponent\Event.
[BC BREAK] The PreRenderEvent namespace was changed from Symfony\UX\TwigComponent\EventListener
to Symfony\UX\TwigComponent\Event.
Add new autowireable ComponentRendererInterface
Added PostRenderEvent and PreCreateForRenderEvent which are dispatched just
before or after a component is rendered.
Added PostMountEvent and PreMountEvent which are dispatched just before
or after the component's data is mounted.
Added Twig template namespaces - #460.
Nothing published for this version
Nothing published for this version
One column per quarter.