Badges are inline block elements that show text and number values. They can be used to attract attention to new or updated content if there are additional items associated with an element.
import SwiftUI
struct ExampleView: View {
@State var badgeText:String = "5"
var body: some View {
XelaBadge(text: $badgeText)
}
}
Name | Type | Default Value | Required | Description |
---|---|---|---|---|
text | Binding < String > | - | YES | Binding value for badge text |
background | Color | Color(xelaColor: .Blue3) | NO | Background color for badge |
foregroundColor | Color | Color(.white) | NO | Foreground color for badge text |