---
title: "listSaver"
description: "The [Saver] implementation which allows to represent your [Original] class as a list of
[Saveable] values.

What types can be saved is defined by [SaveableStateRegistry], by default everything which can be
stored in the Bundle class can be saved.

You can use it as a parameter for [rememberSaveable]."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
public fun <Original, Saveable> listSaver(
    save: SaverScope.(value: Original) -> List<Saveable>,
    restore: (list: List<Saveable>) -> Original?,
): Saver<Original, Any>
```


The `Saver` implementation which allows to represent your `Original` class as a list of
`Saveable` values.

What types can be saved is defined by `SaveableStateRegistry`, by default everything which can be
stored in the Bundle class can be saved.

You can use it as a parameter for `rememberSaveable`.



## Code Examples
### ListSaverSample
```kotlin
@Composable
fun ListSaverSample() {
    data class Size(val x: Int, val y: Int)
    val sizeSaver =
        listSaver<Size, Int>(save = { listOf(it.x, it.y) }, restore = { Size(it[0], it[1]) })
}
```

