Maven Central

Text Flow

Text Flow library for Jetpack Compose.

Allows to display a text which wraps around an image (or any other Composable).


See Demo application and examples.

Simple text around image

Text wrapping a letter to create a Drop Cap

Animating image size and changing the alignment

Annotated string support


Get a dependency

Step 1. Add the MavenCentral repository to your build file. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {

Or in settings.gradle:

pluginManagement {
    repositories {

Step 2. Add the dependency. Check latest version on the releases page.

dependencies {
    implementation "io.github.oleksandrbalan:textflow:$version"

Use in Composable

The TextFlow behaves as a regular Text, but has 2 more arguments:

  • obstacleContent – The content lambda to provide the obstacle composable which will be wrapped by the text. Could be used as trailing lambda.
  • obstacleAlignment – The alignment of the obstacleContent. Text flow supports TopStart (default) and TopEnd alignments.

    text = "Text Flow allows to display a text which wraps around an image (or any other Composable)",
    modifier = Modifier.width(220.dp),
    obstacleAlignment = TextFlowObstacleAlignment.TopStart,
    obstacleContent = {
            imageVector = Icons.Default.Done,
            contentDescription = null,
            modifier = Modifier.padding(4.dp)


View Github