BootstrapIconsCompose is Bootstrap icons pack for Jetpack Compose. This library is inspired by compose-icons and FontAwesomeCompose. svg-to-compose is used to converts SVG to Compose code.
Check the demo here
Add it in project level build.gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
or add it to settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add it to app level build.gradle
dependencies {
implementation "com.github.wiryadev:BootstrapIconsCompose:latest.version"
}
BsIcon composable is provided to make sure streamline size with Material Icons, default Icon composable is used underneath.
BsIcon(bsIcon = BootstrapIcons.Filled.Alarm)
To change the icon size, use size
parameter
BsIcon(bsIcon = BootstrapIcons.Filled.Mic, size = 32.dp)
To use different color, use tint
parameter
BsIcon(bsIcon = BootstrapIcons.Normal.Instagram, tint = MaterialTheme.colors.primary)
BsIcon(bsIcon = BootstrapIcons.Normal.Youtube, tint = Color.Red)
BsIcon(bsIcon = BootstrapIcons.Normal.Facebook, tint = Color(0xFF4267B2))
You can use it with default Icon
composable, but the size will be defaulting to 16.dp
(according to original svg size), therefore not recommended to be used in combination with MaterialIcon that has 24.dp
size by default.
Icon(imageVector = BootstrapIcons.Normal.Alarm, contentDescription = "Alarm")
For more info about Bootstrap icons license, check the official copyright here.