Accent behind text
drawBehind paints a highlight bar under a label.
val accent = MaterialTheme.colorScheme.primary
Text(
text = "Highlighted",
modifier = Modifier
.drawBehind {
drawLine(
color = accent,
start = Offset(0f, size.height),
end = Offset(size.width, size.height),
strokeWidth = 6f,
cap = StrokeCap.Round
)
}
.padding(bottom = 4.dp)
)