> For the complete documentation index, see [llms.txt](https://docs.galex.dev/yamvil/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.galex.dev/yamvil/usage/uistate.md).

# UiState

Example of an UiState for a Dashboard

```kotlin
data class DashboardUiState(
    override val action: Consumable<DashboardUiAction>? = null,
    val state: ContentState,
) : Actionable<DashboardUiAction> {

    sealed interface ContentState {
        data object Loading : ContentState
        data object Error : ContentState
        data class Content(
            val title: String,
            val description: String
        ) : ContentState
    }
}
```

Note that `DashboardUiState` implements the `Actionable` interface for one-time actions sent from the ViewModel to the Fragment, like showing a Dialog or a Snackbar, or navigating to another Screen.

Here's how a child of `MVIViewModel` would send an `UiAction` to the Screen via its `UiState`:

```kotlin
private fun onClickOnNext() {
    update { copy(action = Consumable(DashboardUiAction.NavigateToNext)) }
}
```
