# TextGranularity

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/TextGranularity.kt+class:androidx.compose.ui.text.TextGranularity) Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0) Common/AllAndroid/JVM
- Cmn

  ```
  value class TextGranularity
  ```

*** ** * ** ***

Used by `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getRangeForRect(androidx.compose.ui.geometry.Rect,androidx.compose.ui.text.TextGranularity,androidx.compose.ui.text.TextInclusionStrategy)`. It specifies the minimal unit of the text ranges that is considered by the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getRangeForRect(androidx.compose.ui.geometry.Rect,androidx.compose.ui.text.TextGranularity,androidx.compose.ui.text.TextInclusionStrategy)`.

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextGranularity` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextGranularity#Character()` Character level granularity. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextGranularity` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextGranularity#Word()` Word level granularity. | Cmn |

## Public companion properties

### Character

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

```
val Character: TextGranularity
```

Character level granularity. The text string will be break into ranges each corresponding to a visual character. e.g. "Hi \\uD83D\\uDE00" will be break into: 'H', 'i', ' ', '\\uD83D\\uDE00' (grin face emoji).

### Word

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

```
val Word: TextGranularity
```

Word level granularity. The text string will be break into ranges each corresponding to a word. e.g. "Hello world" wil be break into "Hello", "world" the space character is not considered as a word.