πŸ—» Unopinionated, easy-to-use, and customizable Badge component for Jetpack Compose

Overview

Cobadge

JitPack Android Language Badge Kotlin Language Badge

Badges

πŸ—» 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 'https://jitpack.io' }

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 {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}
rootProject.name = "Your application"

Add the dependency and replace Tag with the latest version.

Latest version is indicated below:

Groovy

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

Kotlin DSL

implementation("com.github.michaelgrigoryan25:cobadge:Tag")

Usage

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

Badge(
    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 = fun() {},
// Badge text font weight
fontWeight: FontWeight = FontWeight.Bold

Contributions

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

You might also like...
A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many compose features are not yet available.
A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many compose features are not yet available.

Multiplatform Compose A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many comp

 Android Clean Architecture with MVVM using Jetpack component
Android Clean Architecture with MVVM using Jetpack component

Android Clean Architecture with MVVM using Jetpack component πŸ’‘ What is Clean Architecture? Clean architecture is a category of software design patter

A simple authentication application using Jetpack compose to illustrate signin and sign up using Mvvm, Kotlin and jetpack compose
A simple authentication application using Jetpack compose to illustrate signin and sign up using Mvvm, Kotlin and jetpack compose

Authentication A simple authentication application using Jetpack compose to illustrate signin and sign up using Mvvm, Kotlin and jetpack compose Scree

Compose-navigation - Set of utils to help with integrating Jetpack Compose and Jetpack's Navigation

Jetpack Compose Navigation Set of utils to help with integrating Jetpack Compose

Easy zoom in with drag support for Jetpack Compose
Easy zoom in with drag support for Jetpack Compose

ComposeZoomableImage Jetpack Compose Zoomable Image Android Library Easy zoom in with drag support for Jetpack Compose Demo Setup Add Jitpack maven {

ToDo-Task-App - An Android App built to demonstrate the use of Jetpack Compose, Material You, Room Database, and MVVM

ToDo Task App ToDo Task App is a sample Android app built with Jetpack Compose.

Jetpack Compose Boids | Flocking Insect 🐜. bird or Fish simulation using Jetpack Compose Desktop πŸš€, using Canvas API 🎨
Jetpack Compose Boids | Flocking Insect 🐜. bird or Fish simulation using Jetpack Compose Desktop πŸš€, using Canvas API 🎨

🐜 🐜 🐜 Compose flocking Ants(boids) 🐜 🐜 🐜 Jetpack compose Boids | Flocking Insect. bird or Fish simulation using Jetpack Compose Desktop πŸš€ , usi

A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!
A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!

Why Not Compose! A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!

This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Compose.
This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Compose.

JetBMICalculator This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Co

Releases(1.0.2)
Owner
Michael Grigoryan
Full-time student and certified language switcher. Carrot supporter πŸ₯•
Michael Grigoryan
ComposeImageBlurhash is a Jetpack Compose component with the necessary implementation to display a blurred image while the real image is loaded from the internet. Use blurhash and coil to ensure good performance.

compose-image-blurhash ComposeImageBlurhash is a Jetpack Compose component with the necessary implementation to display a blurred image while the real

Orlando Novas Rodriguez 24 Nov 18, 2022
An easy to use action/overflow menu for Jetpack Compose.

Compose Action Menu This library provides an easy-to-use action menu for Compose, since Compose doesn't offer this by default. Features Icons (optiona

Jacob Ras 36 Nov 24, 2022
Kotlin, MVVM, Navigation Component, Hilt, Jetpack Compose, Retrofit2

What is this project? This course will replace my old java mvvm introduction: https://codingwithmitch.com/courses/rest-api-mvvm-retrofit2/. Watch the

Mitch Tabian 452 Jan 1, 2023
Android Sample Kotlin+ MVI + Jetpack compose + Coroutines + Retrofit + Hilt + Room + Navigation component

MVIComposeSample Android Sample app to show user latest movies implementing MVI + Clean Architecture using kotlin & Jetpack compose following solid an

Ahmed Atwa 10 Dec 28, 2022
Icontent - Jetpack Compose component to show all random content sended by Inmersoft guide backend

icontent IContent is a library that allows loading audio visual content generica

Orlando Novas Rodriguez 3 Nov 3, 2022
❀️ A heart-shaped toggle switch component built using Jetpack Compose

heart-switch A heart-shaped toggle switch component built using Jetpack Compose. Inspired by Tore Bernhoft's I heart toggle Dribbble shot and Anatoliy

Anton Popov 30 Dec 14, 2022
A Coordinator Layout-like component in Jetpack Compose.

CollapsingToolbarInCompose Branches master: Initial code. column_version: Resulting code using a Column. ?? lazycolumn_version: Resulting code using a

Glenn 38 Dec 9, 2022
Jetpack Compose component box.

Jetpack Compose Component Box About The Project ℹ️ This project is a project where you can find and use custom components in Jetpack Compose. Our goal

Mert Toptas 43 Dec 10, 2022
A Jetpack Compose component used for displaying Markdown-formatted text.

MarkdownText A library for displaying Markdown contents within Jetpack Compose. Uses Coil Current limitations Lists that are annotated with the * must

Arnau Mora 4 Dec 15, 2022
Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

MindOrks 382 Jan 5, 2023