Class

Bullet

Draws a bullet point next to a paragraph.

AnnotatedStringWithBulletListCustomBulletSample

@Composable
@Sampled
fun AnnotatedStringWithBulletListCustomBulletSample() {
    val bullet1 = Bullet.Default.copy(shape = RectangleShape)
    val bullet2 = bullet1.copy(drawStyle = Stroke(2f))
    val bullet3 = bullet1.copy(brush = SolidColor(Color.LightGray))
    BasicText(
        buildAnnotatedString {
            withBulletList(bullet = bullet1) {
                withBulletListItem { append("Item 1") }
                withBulletList(bullet = bullet2) {
                    withBulletListItem { append("Item 2") }
                    withBulletListItem { append("Item 3") }
                    withBulletList(bullet = bullet3) { withBulletListItem { append("Item 4") } }
                }
                withBulletListItem { append("Item 5") }
            }
        }
    )
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: