MiddleEllipsisText
1.2.0indexedText component enables middle ellipsis in text overflow for Jetpack Compose, allowing concise display of long strings. Experimental support for multiple platforms, awaiting official adoption.
Text component enables middle ellipsis in text overflow for Jetpack Compose, allowing concise display of long strings. Experimental support for multiple platforms, awaiting official adoption.
A Text Component with ellipsis in the middle of text for Jetpack Compose and Compose Multiplatform.
If Text comes to support Text-overflow middle cropping, this library will be deprecated.
[!NOTE] From Compose 1.8.0(-alpha02),
MiddleEllipsisTextOverflow has officially supported. It's easier to use it if you don't need to customize ellipsis text or ellipsis text count.
Text(
text = soLongText,
modifier = Modifier,
overflow = TextOverflow.MiddleEllipsis,
maxLines = 1 // if you want single-line ellipsis
)
minSdkVersion: 24
// settings.gradle(.kts)
pluginManagement {
repositories {
// ...
mavenCentral()
}
}
// {module}/build.gradle(.kts)
implementation "io.github.mataku:middle-ellipsis-text:${latestVersion}"
// Material 3 Text
// implementation "io.github.mataku:middle-ellipsis-text3:${latestVersion}"
MiddleEllipsisText and MiddleEllipsisText3 support Compose Multiplatform experimentally and only available for iOS, Android and JVM (desktop).
sourceSets {
val commonMain by getting {
dependencies {
implementation("io.github.mataku:middle-ellipsis-text:${latestVersion}")
}
}
MiddleEllipsisText(
// required
text = "yeah"
)
The same arguments can be specified as for Text composable. See more details: https://github.com/mataku/MiddleEllipsisText/blob/develop/MiddleEllipsisText/src/main/java/io/github/mataku/middleellipsistext/MiddleEllipsisText.kt
| iOS | Android | Desktop |
|---|---|---|
![]() | ![]() | ![]() |
Surfaced from shared tags and platforms — no rankings paid for.