GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

BlazeWidgetItemBadgeStateStyle - iOS

The BlazeWidgetItemBadgeStateStyle struct represents the style configuration for a widget item badge.

Properties

isVisible

var isVisible: Bool

Indicates whether the badge is visible.

📘

Make sure to set the parent badge 'isVisible' property to true if toggled on.

📘

Content with its own badge image from the CMS shows the badge regardless of this value.

width

var width: CGFloat

The width of the badge.

This property ensures that the badge's width is appropriately scaled to match the overall design of the widget item.

height

var height: CGFloat

The height of the badge.

Determines the badge's height, allowing for precise adjustments to its size for content fit or aesthetic purposes. Similar to width, height customization facilitates a cohesive look and feel of the badge within the widget item.

backgroundColor

var backgroundColor: UIColor

The background color of the badge.

It sets the badge's background color, enabling it to stand out or blend with the widget item's theme.

backgroundImage

var backgroundImage: UIImage?

The background image of the badge. Content with its own badge image from the CMS uses that image instead.

This property can be used to incorporate logos, icons, or other visual elements.

cornerRadius

var cornerRadius: CGFloat

The corner radius of the badge.

It controls the badge's corner roundness, contributing to its visual appeal. A higher value results in a more rounded badge, which can be used to soften its appearance or match certain design languages.

cornerRadiusRatio

var cornerRadiusRatio: CGFloat?

The corner radius ratio is a value between 0.0 and 1.0, which computes the final corner radius for the badge. Overrides corner radius property.
For example, a value of 0.5 on a 1:1 width/height badge will result in a perfect circle appearance for the badge.

Provides a relative measure for setting the badge's corner radius, enabling it to achieve a perfect circle or specific curvature based on the badge's dimensions. This property offers an alternative way to define the corner roundness responsively.

borderColor

var borderColor: UIColor

The color of the border.

borderWidth

var borderWidth: CGFloat

The width of the border.

textStyle

var textStyle: BlazeWidgetItemTextStyle

The style configuration for the badge title.

text

var text: String?

The text displayed in the badge.


Did this page help you?