Badge SwiftUI - admiral-team/admiralui-ios GitHub Wiki
The component that shows a quantitative value, usually complements other components, for example, to show the number of alerts in the Bottom navigation or Toolbar section
public struct BadgeView<Content>: View where Content: View
Badge is a component that usually complements other components and shows quantitative scores. For example, a tabs component can show the number of items in a bookmark. Or show the number of notifications in the notification panel.
For configuration badge view need set text.
BadgeView(
badgeStyle: .error,
value: 1
)
Also you can set style for background presentation. For example, if you want show badge with error, we recommend use style error.
BadgeView(
badgeStyle: .error,
value: nil
)
Also you can set an image by passing content property in the initializer.
BadgeView(
badgeStyle: .default,
value: nil,
content: {
Image("Your image")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 50.0, height: 50.0, alignment: .center)
}
)
You can help us to find bugs or ask us to add features.
- To start
issue
please use ready-made templates. - To make changes to the repository, you need to create a
fork
of the project, make changes to the code and create apull request
in our project. You can read more about this in the Github documentation.