Skip to content

wiryadev/bootstrap-icons-compose

Repository files navigation

BootstrapIconsCompose

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.

Demo App

Check the demo here

How to

Add JitPack

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 dependency

Add it to app level build.gradle

dependencies {
	implementation "com.github.wiryadev:BootstrapIconsCompose:latest.version"
}

Usage

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")

License

For more info about Bootstrap icons license, check the official copyright here.

About

Bootstrap icons pack (now v1.5.0) for Jetpack Compose

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages