--- title: currentWindowContainerSize description: A Composable function that returns the current window size and automatically triggers recomposition when the window is resized, enabling responsive layouts. ---
| Return Type | Description | |-------------|-------------| | `DpSize` | The current window container size with `width` and `height` properties in Dp units |
## Code Examples ### Basic Example Use `currentWindowContainerSize()` to get the current window dimensions: ```compose id="currentwindowcontainersize-basic" height=100 import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.sp import com.composeunstyled.Text import com.composeunstyled.currentWindowContainerSize COMPOSE { val containerSize = currentWindowContainerSize() Text( "This container size is ${containerSize.width} x ${containerSize.height}", style = TextStyle( fontSize = 20.sp, fontWeight = FontWeight.Medium ) ) } ``` > **HINT:** Resize your __browser's__ width to see the size changing. ```kotlin import com.composeunstyled.currentWindowContainerSize ``` ```kotlin val containerSize = currentWindowContainerSize() ```