# rememberPlaceholderState

## Functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/PlaceholderState` | `@https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ExperimentalWearMaterialApi @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/material/rememberPlaceholderState.composable#rememberPlaceholderState(kotlin.Function0)(isContentReady: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/PlaceholderState` that is remembered across compositions. |

## Functions

### rememberPlaceholderState

Artifact: [androidx.wear.compose:compose-material](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material/Placeholder.kt+function:rememberPlaceholderState) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.1.0)

```
@ExperimentalWearMaterialApi
@Composable
fun rememberPlaceholderState(isContentReady: () -> Boolean): PlaceholderState
```

Creates a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/PlaceholderState` that is remembered across compositions. To start placeholder animations run `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/PlaceholderState#startPlaceholderAnimation()`.

A `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/PlaceholderState` should be created for each component that has placeholder data. The state is used to coordinate all of the different placeholder effects and animations.

Placeholder has a number of different effects designed to work together. `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/placeholder.composable#(androidx.compose.ui.Modifier).placeholder(androidx.wear.compose.material.PlaceholderState,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color)` draws a placeholder shape on top of content that is waiting to load. There can be multiple placeholders in a component. `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/placeholderShimmer.composable#(androidx.compose.ui.Modifier).placeholderShimmer(androidx.wear.compose.material.PlaceholderState,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color)` does a shimmer animation over the whole component that includes the placeholders. There should only be one placeholderShimmer for each component.

Background placeholder effects are used to mask the background of components like chips and cards until all of the data has loaded. Use `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/PlaceholderDefaults#placeholderBackgroundBrush(androidx.wear.compose.material.PlaceholderState,androidx.compose.ui.graphics.Color)` and `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/PlaceholderDefaults#painterWithPlaceholderOverlayBackgroundBrush(androidx.wear.compose.material.PlaceholderState,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.Color)` to draw the component background.

Once all of the components content is loaded, `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/package-summary#rememberPlaceholderState(kotlin.Function0)` is `true` the shimmer will stop and a wipe off animation will remove the placeholders to reveal the content.

| Parameters |
|---|---|
| `isContentReady: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | a lambda to determine whether all of the data/content has been loaded for a given component and is ready to be displayed. |