Member-only story
Suggestion Chips in Jetpack Compose

Hello everyone , hope you all are doing good. So in this article we will see what is suggestion chips & how we can create with jetpack compose😍.
Basically suggestion Chips is introduced in material 3 library & right now it’s in beta version. In suggestion chips, there is some suggest data , we can select only one data & content will show according to selected data.
In this above image we can see that we have three (india , france , spain) suggest data & we can only select one. Let see how we can make this.

Make sure you choose
Empty Compose Activity(Material 3)
& click on next. Below is the dependencies , be sure you also have the same.
First let’s create layout for our chip, because we will only create one chip & reuse again & again , that’s the beauty of using compose.
As you can see in the above code we have label(title)
for chips , selected
indicate that which is one selected , & onChipChange
lambda function will update the chip state.
If you want to create suggestion chips then we have SuggestionChip
Composable function & it takes lot of parameters , onClick {}
will change the state of chip , label
means title of chip , shape
means shape of chips , here we have used RoundedCornerShape(8.dp) , colors
here we just change the background color of our chips , if it’s selected , change to purple otherwise transparent , border
here we…