CommercialMessage

fun CommercialMessage(value: String, type: CommercialMessageType, modifier: Modifier = Modifier, variant: CommercialMessageVariant = Emphasised, size: CommercialMessageSize = CommercialMessageSize.Small)(source)

Commercial Message component is a badge that adorns range products with an IKEA sales steering category. It is built on top of androidx.compose.material3.Text and comes with pre-defined appearance based on Skapa design and guidelines.

Parameters

value

The text to be displayed inside the component.

type

defines the Commercial Message type style. There is no default type, it always has to be declared.

modifier

Modifier to be applied to the CommercialMessage.

variant

CommercialMessageVariant defines the Commercial Message variant. The default variant is CommercialMessageVariant.Emphasised.

size

CommercialMessageSize defines the Commercial Message size. The default size is CommercialMessageSize.Small.

See also

Samples

SkapaTheme2(isSystemInDarkTheme()) {
    Column(horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.SpaceEvenly) {
        // New
        CommercialMessage("New", CommercialMessageType.New)
        CommercialMessage("New", CommercialMessageType.New, variant = CommercialMessageVariant.Subtle)

        // New lower price
        CommercialMessage("New lower price", CommercialMessageType.NewLowerPrice)
        CommercialMessage("New lower price", CommercialMessageType.NewLowerPrice, variant = CommercialMessageVariant.Subtle)

        // IKEA Family price
        CommercialMessage("IKEA Family price", CommercialMessageType.IkeaFamilyPrice)
        CommercialMessage("IKEA Family price", CommercialMessageType.IkeaFamilyPrice, variant = CommercialMessageVariant.Subtle)
    }
}