Badge

Badges are static components that show helpful details or attributes.

Backpack-SwiftUI/Badge

Cocoapods class reference view on Github

Default

Day Night

Usage

Basic text badge

If you don't specify a .badgeStyle(<style>) it will use the .default type


                                                
                                                import Backpack_SwiftUI
                                                
                                                BPKBadge("Hello World")
                                                
                                                BPKBadge("Hello World")
                                                    .badgeStyle(.destructive)

Badge with icon

If you don't specify a .badgeStyle(<style>) it will use the .default type


                                                
                                                import Backpack_SwiftUI
                                                
                                                BPKBadge("Hello World", icon: .tickCircle)
                                                
                                                BPKBadge("Hello World", icon: .tickCircle)
                                                    .badgeStyle(.destructive)