Skip to content

Instantly share code, notes, and snippets.

@victorbrndls
Last active November 10, 2021 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorbrndls/60f0fa5f7d9d3a808f4c2a4b914ff27e to your computer and use it in GitHub Desktop.
Save victorbrndls/60f0fa5f7d9d3a808f4c2a4b914ff27e to your computer and use it in GitHub Desktop.
data class Elevations(val card: Dp = 0.dp, val default: Dp = 0.dp)
val LocalElevations = compositionLocalOf { Elevations() } // Create composition with default value
val elevations = Elevations(card = 4.dp, default = 2.dp) // Provide different value here
CompositionLocalProvider(LocalElevations provides elevations) { ... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment