> 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/composable.md).

# Composable

A Dashboard Composable Screen example

```kotlin
@Composable
fun DashboardScreen(
    uiState: DashboardUiState,
    handleEvent: (DashboardUiEvent) -> Unit,
    modifier: Modifier = Modifier
) {
    LaunchedActionEffect(uiState) { action: DashboardUiAction ->
        when (action) {
            DashboardUiAction.NavigateToNext -> {}
        }
    }

    when (uiState.state) {
        is DashboardUiState.ContentState.Loading -> DashboardLoadingContent()
        is DashboardUiState.ContentState.Error -> DashboardErrorContent()
        is DashboardUiState.ContentState.Content -> DashboardContent(uiState.state)
    }
}

@Composable
fun DashboardLoadingContent(
    modifier: Modifier = Modifier
) {
    // Do something with loading
}

@Composable
fun DashboardErrorContent(
    modifier: Modifier = Modifier
) {
    // Do something with error
}

@Composable
fun DashboardContent(
    content: DashboardUiState.ContentState.Content,
    modifier: Modifier = Modifier
) { 
    // Do something with content
}
```

Note that as `DashboardUiState` implements `Actionable` , we need to use the  `LaunchedActionEffect` function to consume only once the `UiAction`:

```kotlin
LaunchedActionEffect(uiState) { action: DashboardUiAction ->
    when (action) {
        DashboardUiAction.NavigateToNext -> {}
    }
}
```
