# Hyphens

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

  ```
  value class Hyphens
  ```

*** ** * ** ***

Automatically hyphenates words when wrapping text.

Inserts hyphens at syllable boundaries based on language rules.

Suggest manual line break opportunities using:

- **Soft hyphen (`\u00AD`)**: Marks a wrapping opportunity. The hyphen is only visible if the word wraps at this point.

- **Hard hyphen (`\u2010`)**: Inserts a permanently visible hyphen that also allows wrapping.

Default is `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#None()` (no automatic hyphenation).

## Summary

| ### Public companion functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#valueOf(kotlin.Int)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens` from `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens.Companion#valueOf(kotlin.Int)`. | Cmn |

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#Auto()` Breaks words automatically at syllable boundaries. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#None()` Lines will break with no hyphenation. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#Unspecified()` Represents an unset `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens` value. | Cmn |

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#value()` internal integer representation of the hyphenation mode. | Cmn |

| ### Extension functions |
|---|---|---|
| `inline https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#(androidx.compose.ui.text.style.Hyphens).takeOrElse(kotlin.Function0)(block: () -> https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens)` If `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/package-summary#(androidx.compose.ui.graphics.Color).isSpecified()` is true then this is returned, otherwise `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/package-summary#(androidx.compose.ui.text.style.Hyphens).takeOrElse(kotlin.Function0)` is executed and its result is returned. | Cmn |

| ### Extension properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#(androidx.compose.ui.text.style.Hyphens).isSpecified()` Returns `true` if it is not `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#Unspecified()`. | Cmn |

## Public companion functions

### valueOf

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

```
fun valueOf(value: Int): Hyphens
```

Creates `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens` from `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens.Companion#valueOf(kotlin.Int)`.

Useful for serialization/deserialization.

| Parameters |
|---|---|
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | internal integer representation. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens.Companion#valueOf(kotlin.Int)` is invalid. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#value()` |   |

## Public companion properties

### Auto

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

```
val Auto: Hyphens
```

Breaks words automatically at syllable boundaries.

Manual suggestions (like soft hyphens) override automatic breaks.

```
+---+
| Experi- |
| mental  |
+---+
```

### None

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

```
val None: Hyphens
```

Lines will break with no hyphenation.

"Hard" hyphens will still be respected. However, no automatic hyphenation will be attempted. If a word must be broken due to being longer than a line, it will break at any character and will not attempt to break at a syllable boundary.

```
+---+
| Experim |
| ental   |
+---+
```

### Unspecified

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

```
val Unspecified: Hyphens
```

Represents an unset `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens` value.

## Public functions

### toString

Cmn

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

## Public properties

### value

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

```
val value: Int
```

internal integer representation of the hyphenation mode.

## Extension functions

### Hyphens.takeOrElse

Cmn 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/style/Hyphens.kt+function:takeOrElse)

```
inline fun Hyphens.takeOrElse(block: () -> Hyphens): Hyphens
```

If `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/package-summary#(androidx.compose.ui.graphics.Color).isSpecified()` is true then this is returned, otherwise `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/package-summary#(androidx.compose.ui.text.style.Hyphens).takeOrElse(kotlin.Function0)` is executed and its result is returned.

## Extension properties

### Hyphens.isSpecified

Cmn 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/style/Hyphens.kt+symbol:isSpecified)

```
val Hyphens.isSpecified: Boolean
```

Returns `true` if it is not `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#Unspecified()`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/Hyphens#Unspecified()` |   |