Add chips to your apps built with Jetpack Compose!

Related tags

Jetpack Compose Chip
Overview

Chip

Add chips to your apps built with Jetpack Compose!

To get started with Chip just add the maven url and the Chip dependency

build.gradle (Project level)

allprojects {
    repositories {
    ...
    //Add this url
    maven { url 'https://jitpack.io' }
    }
}

If you are using Android Studio Arctic Fox and above where you don't have allProjects in build.gradle then add following maven url in settings.gradle like below

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        //Add this url
        maven { url 'https://jitpack.io' }
        jcenter() // Warning: this repository is going to shut down soon
    }
}

Once you have added the maven url now add the Chip dependency in the build.gradle (module level)

implementation 'com.github.raipankaj:Chip:1.0.0'

Congratulations, you have successfully added the dependency. Now to get started with Chip add the following code snippet

//Your logic based on selected chip } ">
val chipAssistItem = listOf(
                        ChipItem("Account", ChipType.Assist(Icons.Default.AccountBox)),
                        ChipItem("Search", ChipType.Assist(Icons.Default.Search)),
                        ChipItem("Filter", ChipType.Assist(Icons.Default.List))
                    )

Chip(labels = chipAssistItem) { selectedChip ->
    //Your logic based on selected chip
}

Chip composable provide an ability to change the background color of chip, default text color and text color when chip is selected. Here are all the parameters accepted by Chip composable.
fun Chip(labels: List<ChipItem>,
         defaultTextColor: Color = Color.Black,
         selectedTextColor: Color = Color.White,
         chipColor: Color = Color.Blue.copy(0.5f),
         chipOnClick: (String) -> Unit) 

The various types of Chips that are currently supported are
1. Assist
2. Filter
3. Suggestion

Demo


Note: If you like this library, then please hit the star button! 😃
You might also like...
🔖 A Quotes Application built to Demonstrate the Jetpack Compose UI
🔖 A Quotes Application built to Demonstrate the Jetpack Compose UI

🔖 A Quotes Application built to Demonstrate the Jetpack Compose UI

JetFlix - A clone of Android NetFlix app in Android built using Jetpack compose.
JetFlix - A clone of Android NetFlix app in Android built using Jetpack compose.

JetFlix A clone of Android NetFlix app in Android built using Jetpack compose. This sample app showcases the following: MVVM Architecture (ViewModel +

A Rick and Morty app built with Jetpack Compose.
A Rick and Morty app built with Jetpack Compose.

RickAndMortyCompose A Rick and Morty app built with Jetpack Compose. 📱 Demo ✨ Features Compose UI Kotlin Coroutines Compose Navigation MVVM Architect

Experimental Graphviz code generation POC built with Jetpack Compose compiler/runtime.
Experimental Graphviz code generation POC built with Jetpack Compose compiler/runtime.

Compose Dot Experimental proof of concept to generate GraphViz dot code via Jetpack Compose's tree management. Valid dot file content can be generated

A beautiful Undo Redo animation built with Jetpack Compose
A beautiful Undo Redo animation built with Jetpack Compose

A beautiful Undo Redo animation built with Jetpack Compose

This app can be used to track open slots for vaccination. This is built using Jetpack Compose.
This app can be used to track open slots for vaccination. This is built using Jetpack Compose.

Covid Vaccine This projects used the Cowin APIs provided by the government. Screenshots Tech Stack Used Kotlin Dagger Hilt Clean Architecture with Mod

🧱  A tetris game fully built using Jetpack Compose
🧱 A tetris game fully built using Jetpack Compose

A tetris game fully built using Jetpack Compose, almost all UI elements are created by code, including the following app icon, which is also generated by Composable with @Preview.

Telegram ui clone built with Jetpack Compose

Telegram UI clone Make telegram ui with Jetpack Compose. Library Jetpack Compose v1.0.1 Compose Icon v1.0.3 Minimum requirements Android Studio Arctic

Kuberam is built on jetpack compose + Auth0 during Hashnode Hackathon.
Kuberam is built on jetpack compose + Auth0 during Hashnode Hackathon.

Kuberam Kuberam is an app to manage your transactions. Application Install You can Install Kuberam app from Play Store 👇 Insights into the app 🔎 Dar

Releases(1.0.0)
Owner
Pankaj Rai
I am an android developer who likes to learn new technologies and bring ideas into reality for the betterment of a large community.
Pankaj Rai
JetCam - Add camera capability to app built with Jetpack Compose

JetCam Add camera capability to your app with just a single method - JetCam To g

Pankaj Rai 6 Jul 8, 2022
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

BHAVNA THACKER 3 Dec 31, 2022
Jetpack-compose-uis - A collection of some UIs using Jetpack Compose. built using Katalog

Jetpack Compose UIs This is a collection of some UIs using Jetpack Compose. It i

Mori Atsushi 3 Dec 15, 2022
From Swedish "Öppettider", an app to quickly access your favorite places' opening times. Built to practice Android development and try out Jetpack Compose.

Appettider From Swedish "Öppettider", an app to quickly access your favorite places' opening times. Built to practice Android development and try out

Arianna Masciolini 0 Dec 6, 2021
FullMangement - an application that helps you manage your tasks effectively. built with the latest tachs like Compose UI, Jetpack libraries, and MVVM design pattern.

Full Management is an application that helps you manage your tasks effectively. built with the latest tachs like Compose UI, Jetpack libraries and MVVM design pattern.

Amr algnyat 4 Nov 1, 2022
📱 WhatsApp clone project demonstrates modern Android development built with Jetpack Compose and Stream Chat SDK for Compose.

This is a WhatsApp clone app built with Jetpack Compose and Stream Chat SDK for Compose. The purpose of this repository is to demonstrate below: Imple

Stream 689 Dec 25, 2022
A framework for building responsive Android apps using Jetpack Compose

Jetmagic - A framework for building responsive Android apps using Jetpack Compose Jetmagic is an Android framework that can be used to develop respons

Johann Blake 93 Dec 17, 2022
Some tips for developers who will involve Jetpack Compose in new APPs

Compose TakeAway 给即将用Jetpack Compose开发APP的开发人员 1. Jetpack Compose vs Xml Pros: 声明式UI,纯kotlin 代码更少 可直接兼容现有View - 双向兼容 性能更好(measure次数减少...) UI自定义更简单 没有a

Le 2 Mar 24, 2022
A minimalist framework for rapidly building Jetpack compose apps.

VelocityX Show some ❤️ and star the repo. Subscribe to Codepur VelocityX is a 100% free Jetpack open-source minimalist UI Framework built with Kotlin

Pawan Kumar 24 Oct 29, 2022
Explode compose elements on click! Just add explodeOnClick() modifier!

compose-explode Explode compose elements on click! Just add explodeOnClick() modifier! Inspired from ExplosionField Getting started Go to library/expl

Nikhil Chaudhari 33 Jan 8, 2023