Composables
WARNING
Single File Component (SFC) support for Administration extensions is experimental. It is currently only available on the trunk branch of shopware/shopware and is not part of any 6.7 release. The APIs described on this page can still change without a deprecation.
All composables the Administration offers are experimental. Their names, options and return values can still change without a deprecation, so pin down what you rely on and tell us when one of them does not fit what you are building.
Override composables
Three of them are injected by the build like the macros are, so you never import them, and they exist only inside an .override.vue file. They are how an override reaches the component it overrides.
A base component needs none of them: it declares its own props with defineProps() and its own events with defineEmits().
Administration composables
Everything else is imported, one module per composable, named after it in kebab-case:
import { useNotification } from 'shopware:composables/use-notification';Most of them are the Composition API side of a mixin. A mixin declared its own props and read them off this; a composable has neither, so whatever the mixin used to take from its host is passed in, and getters keep it reactive:
const { isBetween, betweenValue } = useRuleBetweenOperator({
condition: () => props.condition,
ensureValueExist: () => emit('ensure-value-exist'),
});The mixins stay where they are, so an Options API component that has not been migrated keeps working.