currentWindowContainerSize

A Composable function that returns the current window size and automatically triggers recomposition when the window is resized, enabling responsive layouts.
Return TypeDescription
DpSizeThe current window container size with width and height properties in Dp units

Code Examples

Basic Example

Use currentWindowContainerSize() to get the current window dimensions:

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

HINT: Resize your browser's width to see the size changing.

import com.composeunstyled.currentWindowContainerSize
val containerSize = currentWindowContainerSize()