Skip to content

Instantly share code, notes, and snippets.

@Suchiq
Created April 11, 2025 07:18
Show Gist options
  • Select an option

  • Save Suchiq/e0bfcbd8d9b4f6d5bb8c49a3e7d6f05c to your computer and use it in GitHub Desktop.

Select an option

Save Suchiq/e0bfcbd8d9b4f6d5bb8c49a3e7d6f05c to your computer and use it in GitHub Desktop.
@Composable
fun HorizontalBox(onTextOverflow: (Boolean) -> Unit) {
Row {
OverflowAwareButton(text = "Very long text that might overflow", onTextOverflow = onTextOverflow)
OverflowAwareButton(text = "Another Button", onTextOverflow = onTextOverflow)
}
}
@Composable
fun VerticalBox() {
Column {
Button(onClick = {}) {
Text(
text = "Very long text that might overflow",
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
}
Button(onClick = {}) {
Text(
text = "Another Button",
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment