Block components
WARNING
Single File Component (SFC) support for Administration extensions is experimental. It is available since Shopware 6.7.16.0. The APIs described on this page can still change without a deprecation. Try it out and tell us what you find, but do not ship an extension built on it to customers or to the Shopware Store until the API is declared stable (planned for 6.9).
Two globally registered components carry the native block system. You write the tags without importing anything.
The model
A component declares an extension point by wrapping markup in <sw-block name="…">. Its children are the default content, and with nothing registered against the name it renders as though the wrapper were not there.
An override contributes to that point with <sw-block extends="…">. That tag renders nothing where it stands: it registers its content, and the matching <sw-block name> renders it wherever that happens to be.
<!-- swag-greeting-card.vue -->
<sw-block name="swag_greeting_card_body">
<p>Default content</p>
</sw-block>
<!-- swag-greeting-card.override.vue -->
<sw-block extends="swag_greeting_card_body">
<sw-block-parent />
<p>Mine, underneath</p>
</sw-block>Names
A block name is a plain string and nothing validates it, so a typo matches nothing and fails silently. Names must be unique per component.
The convention is an owner prefix, then the path through the component, in snake_case:
sw_product_detail_base_price_form
swag_greeting_card_bodyCore uses sw_; a plugin uses its own prefix. A block name you find in core is covered by the backwards-compatibility promise: it stays until the next major version, and if one is removed in a major, the changelog names it. When core converts a component to a Single File Component, its block names stay the same.
Chains
Several overrides may target one block. They stack in registration order, and each one's <sw-block-parent /> renders the previous one's output rather than the original default. Leaving <sw-block-parent /> out replaces everything below it, which is how one plugin removes another plugin's contribution.