Badge

Badges are static components that show helpful details or attributes.

Badge

Maven Central Class reference Source code

Default

Day Night
Badge component Badge component - dark mode

Installation

Backpack Compose is available through Maven Central. Check the main Readme for a complete installation guide.

Usage

Example of a Badge:


                                                
                                                import net.skyscanner.backpack.compose.badge.BpkBadge
                                                import net.skyscanner.backpack.compose.badge.BpkBadgeType
                                                
                                                BpkBadge(
                                                  text = "Badge text",
                                                  type = BpkBadgeType.Normal,
                                                )

Example of a Badge with icon:


                                                
                                                import net.skyscanner.backpack.compose.badge.BpkBadge
                                                import net.skyscanner.backpack.compose.badge.BpkBadgeType
                                                import net.skyscanner.backpack.compose.icon.BpkIcon
                                                import net.skyscanner.backpack.compose.tokens.TickCircle
                                                
                                                BpkBadge(
                                                  text = "Badge text",
                                                  type = BpkBadgeType.Normal,
                                                  icon = BpkIcon.TickCircle,
                                                )