# Bullet

Artifact: [androidx.compose.ui:ui-text](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/Bullet.kt+class:androidx.compose.ui.text.Bullet) Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0) Common/AllAndroid/JVM
- Cmn

  ```
  class Bullet : AnnotatedString.Annotation
  ```

*** ** * ** ***

Draws a bullet point next to a paragraph.

Bullets do not add indentation. The call site must provide sufficient leading space to accommodate the bullet and its padding, preventing overlap with the text.

There are several ways to achieve this leading space. One common approach is to use `ParagraphStyle` with `textIndent` within an `AnnotatedString`.

```kotlin
import androidx.compose.foundation.text.BasicText
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.Bullet
import androidx.compose.ui.text.buildAnnotatedString

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") }
        }
    }
)
```

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#Default()` Default bullet used in AnnotatedString's bullet list | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#DefaultIndentation()` Indentation required to fit `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#Default()` bullet. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#DefaultPadding()` Padding between bullet and start of paragraph for `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#Default()` bullet | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#DefaultSize()` Height and width for `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#Default()` bullet. | Cmn |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#Bullet(androidx.compose.ui.graphics.Shape,androidx.compose.ui.unit.TextUnit,androidx.compose.ui.unit.TextUnit,androidx.compose.ui.unit.TextUnit,androidx.compose.ui.graphics.Brush,kotlin.Float,androidx.compose.ui.graphics.drawscope.DrawStyle)( shape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape, width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit, height: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit, padding: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit, brush: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush?, alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, drawStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawStyle )` | Cmn |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#copy(androidx.compose.ui.graphics.Shape,androidx.compose.ui.unit.TextUnit,androidx.compose.ui.unit.TextUnit,androidx.compose.ui.unit.TextUnit,androidx.compose.ui.graphics.Brush,kotlin.Float,androidx.compose.ui.graphics.drawscope.DrawStyle)( shape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape, width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit, height: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit, padding: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit, brush: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush?, alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, drawStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawStyle )` Copies the existing `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet` replacing some of the fields as desired. | Cmn |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#hashCode()()` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#alpha()` opacity to be applied to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#brush()` drawing a bullet from 0.0f to 1.0f representing fully transparent to fully opaque respectively. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#brush()` brush to draw a bullet with. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#drawStyle()` defines the draw style of the bullet, e.g. a fill or a stroke | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#height()` the height of the bullet | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#padding()` the padding between the end of the bullet and the start of the paragraph | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#shape()` the shape of the bullet to draw | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#width()` the width of the bullet | Cmn |

## Public companion properties

### Default

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
val Default: Bullet
```

Default bullet used in AnnotatedString's bullet list

### DefaultIndentation

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
val DefaultIndentation: TextUnit
```

Indentation required to fit `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#Default()` bullet.

### DefaultPadding

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
val DefaultPadding: TextUnit
```

Padding between bullet and start of paragraph for `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#Default()` bullet

### DefaultSize

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
val DefaultSize: TextUnit
```

Height and width for `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#Default()` bullet.

## Public constructors

### Bullet

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
Bullet(
    shape: Shape,
    width: TextUnit,
    height: TextUnit,
    padding: TextUnit,
    brush: Brush? = null,
    alpha: Float = Float.NaN,
    drawStyle: DrawStyle = Fill
)
```

| Parameters |
|---|---|
| `shape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` | the shape of the bullet to draw |
| `width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | the width of the bullet |
| `height: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | the height of the bullet |
| `padding: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` | the padding between the end of the bullet and the start of the paragraph |
| `brush: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush? = null` | brush to draw a bullet with. If `null` is passed, the bullet will be drawn like the rest of the text |
| `alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Float.NaN` | opacity to be applied to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#brush()` drawing a bullet from 0.0f to 1.0f representing fully transparent to fully opaque respectively. When `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/-companion/-na-n.html` is passed, the alpha will not be changed and the one used for drawing rest of the text is used |
| `drawStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawStyle = Fill` | defines the draw style of the bullet, e.g. a fill or a stroke |

## Public functions

### copy

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun copy(
    shape: Shape = this.shape,
    width: TextUnit = this.width,
    height: TextUnit = this.height,
    padding: TextUnit = this.padding,
    brush: Brush? = this.brush,
    alpha: Float = this.alpha,
    drawStyle: DrawStyle = this.drawStyle
): Bullet
```

Copies the existing `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet` replacing some of the fields as desired.

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

Cmn

```
open fun hashCode(): Int
```

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### alpha

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
val alpha: Float
```

opacity to be applied to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet#brush()` drawing a bullet from 0.0f to 1.0f representing fully transparent to fully opaque respectively. When `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/-companion/-na-n.html` is passed, the alpha will not be changed and the one used for drawing rest of the text is used

### brush

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
val brush: Brush?
```

brush to draw a bullet with. If `null` is passed, the bullet will be drawn like the rest of the text

### drawStyle

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
val drawStyle: DrawStyle
```

defines the draw style of the bullet, e.g. a fill or a stroke

### height

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
val height: TextUnit
```

the height of the bullet

### padding

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
val padding: TextUnit
```

the padding between the end of the bullet and the start of the paragraph

### shape

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
val shape: Shape
```

the shape of the bullet to draw

### width

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
val width: TextUnit
```

the width of the bullet