🗻 Unopinionated, easy-to-use, and customizable Badge component for Jetpack Compose

Getting started

In this section I will walk you through the steps to add Cobadge to your Android app.

Add the JitPack repository to your build file

Add this line at the end of repositories:

maven { url '' }

If your project is set to fail on project repositories, then add that line to settings.gradle file in repositories field, so that it looks approximately like this

dependencyResolutionManagement {
    repositories {
        maven { url '' }
} = "Your application"

Add the dependency and replace Tag with the latest version.

Latest version is indicated below:


implementation 'com.github.michaelgrigoryan25:cobadge:Tag'

Kotlin DSL



Using Cobadge is really easy! Here's an example:

    color = Color200,
    text = "Hello World"

Here are all the options that Cobadge takes. Fortunately, most of them are optional.

// Badge text
text: String,
// Badge background color
color: Color,
// Badge size (calculated automatically)
size: Size = Size.MD,
// Outer badge padding
paddingSelf: Dp = 4.dp,
// Supports clicking
isClickable: Boolean = true,
// Badge rounding (calculated automatically)
rounded: Rounding = Rounding.XL,
// Badge background color transparency
backgroundColorOpacity: Float = 1f,
// Badge text color
textColor: Color = Color.Unspecified,
// Action that is going to get triggered on click
onClickAction: () -> Unit = {},
// Badge text font weight
fontWeight: FontWeight = FontWeight.Bold


Contributions to Cobadge are welcome! Saw a bug? Create a pull request! Have a suggestion? Create an issue or start a discussion!

Author: Michael Grigoryan