runtime-saveable
Functions
  • SaveableStateRegistry
  • Saver
  • autoSaver
  • listSaver
  • mapSaver
Composable Functions
  • rememberSaveable
  • rememberSaveableStateHolder
  • rememberSerializable
Interfaces
  • SaveableStateHolder
  • SaveableStateRegistry
  • SaveableStateRegistry.Entry
  • Saver
  • SaverScope
Properties
  • LocalSaveableStateRegistry
Jetpack Compose / Compose Runtime / runtime-saveable / Functions / mapSaver
Function

mapSaver

View Markdown Open in ChatGPT Open in Claude

The Saver implementation which allows to represent your class as a map of values which can be saved individually.

CodeRabbit

CodeRabbit

AI writes the code. CodeRabbit catches the slop.

AdTry CodeRabbit for Free
Robomori

Robomori

Run Android emulators and devices outside Android Studio.

AdTry Robomori
API

Examples

MapSaverSample

@Sampled
@Composable
fun MapSaverSample() {
    data class User(val name: String, val age: Int)

    val userSaver = run {
        val nameKey = "Name"
        val ageKey = "Age"
        mapSaver(
            save = { mapOf(nameKey to it.name, ageKey to it.age) },
            restore = { User(it[nameKey] as String, it[ageKey] as Int) },
        )
    }
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free →

Content updated: 2026-11-04

listSaver ← Previous rememberSaveable Next →

On this page

  • MapSaverSample
Reach Android developers Put your product in front of engineers building Android and KMP apps. Sponsor Composables