Icon

A suite of icons for representing concepts, features and actions.

Icon

Maven Central Class reference Source code

Default

Day Night
Icon component Icon component - dark mode

Installation

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

Usage

Example of an icon:


                                                
                                                import net.skyscanner.backpack.compose.icon.BpkIcon
                                                import net.skyscanner.backpack.compose.tokens.BpkIcon
                                                
                                                BpkIcon(
                                                  icon = BpkIcon.LongArrowLeft,
                                                  contentDescription = myContentDescription,
                                                )

Example of a large icon:


                                                
                                                import net.skyscanner.backpack.compose.icon.BpkIcon
                                                import net.skyscanner.backpack.compose.icon.BpkIconSize
                                                import net.skyscanner.backpack.compose.tokens.BpkIcon
                                                
                                                BpkIcon(
                                                  icon = BpkIcon.LongArrowLeft,
                                                  contentDescription = myContentDescription,
                                                  size = BpkIconSize.Large,
                                                )

If you receive icon names from the server, you can use the BpkIcon.findByName method to retrieve the icon:


                                                
                                                import net.skyscanner.backpack.compose.icon.BpkIcon
                                                import net.skyscanner.backpack.compose.tokens.BpkIcon
                                                
                                                val icon = BpkIcon.findByName("add-circle")
                                                icon?.let {
                                                    BpkIcon(
                                                        icon = it,
                                                        contentDescription = myContentDescription,
                                                    )
                                                }