Shopware Design

useFutureFlags

useFutureFlags is internal to the component library and is not exported from the package. It is documented for contributors building or extending Meteor components. Applications opt into flags through the Theme Providerfuture prop, not this composable.

Usage

useFutureFlags returns the future flags currently provided by the nearest Theme Provider. Call it inside a component to adapt behavior when a flag is enabled, for example dropping a default margin once removeDefaultMargin is on. When no Theme Provider is mounted, every flag falls back to false.

import { computed } from "vue";
import { useFutureFlags } from "../../composables/useFutureFlags";

const futureFlags = useFutureFlags();

const hasDefaultMargin = computed(() => !futureFlags.removeDefaultMargin);

API

useFutureFlags() returns a FutureFlags object:

FlagTypeDefaultDescription
removeCardWidthbooleanfalseRemoves the maximum width constraint from mt-card.
removeDefaultMarginbooleanfalseRemoves the default outer margin from components such as cards, tabs, checkboxes, switches, and text fields.
removeSwitchMinHeightbooleanfalseRemoves the minimum height from a non-bordered mt-switch.
bannerFullWidthbooleanfalseMakes mt-banner span the full width of its container.