Badge

A component that is used to display status, notification counts, or labels.

Preview

Button Preview

Code Example

let model = BadgeVM {
  $0.title = "Badge"
  $0.color = .success
  $0.style = .light
  $0.font = .mdButton
  $0.paddings = .init(horizontal: 12, vertical: 10)
}

API

BadgeVM Props

A model that defines the appearance properties for a badge component.

NameTypeDefaultDescription
titleString""The text displayed on the badge.
colorComponentColor?nilThe color of the badge.
cornerRadiusComponentRadiusmediumThe corner radius of the badge.
fontUniversalFont.smButtonThe font used for the badge's text.
isEnabledBooltrueA Boolean value indicating whether the badge is enabled or disabled.
paddingsPaddingsPaddings(horizontal: 10, vertical: 8)Paddings for the badge.
styleStylefilledThe visual style of the badge.

SUBadge

public init(model: BadgeVM)

UKBadge

Initializers

public init(model: BadgeVM)

Public Properties

NameTypeDescription
modelButtonVMA model that defines the appearance properties.

Public Subviews

NameTypeDescription
titleLabelUILabelA label that displays the title from the model.