Useful Modifiers In Jetpack Compose Part — I

Jayant Kumar🇮🇳
2 min readOct 8, 2023
Photo by Ehimetalor Akhere Unuabona on Unsplash

In this article we will see some useful modifiers in jetpack , that you must aware about it.

1). border Modifier

@Composable
fun MakeBorder(
modifier: Modifier = Modifier
) {

Box(modifier = modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
Spacer(
modifier = Modifier
.border(
color = Color.Red,
width = 2.dp,
shape = CircleShape
)
.size(100.dp)
)
}

}

2). horizontalScroll Modifier

@Composable
fun HorizontalScroll(
modifier: Modifier = Modifier
) {

val scrollState = rememberScrollState()

Row(
modifier = modifier
.padding(20.dp)
.horizontalScroll(scrollState)
.fillMaxSize(),
verticalAlignment = Alignment.CenterVertically
) {
repeat(10) {
Text(
text = "Text $it",
style = TextStyle(
fontSize = 20.sp,
fontWeight = FontWeight.W600
),
modifier =…

--

--

Jayant Kumar🇮🇳
Jayant Kumar🇮🇳

Written by Jayant Kumar🇮🇳

Hello My name is Jayant Kumar, I am a software Engineer , specialist in Mobile Development (Android , IOS , Flutter , React Native and Ionic) from India 🇮🇳

No responses yet