---
title: "WindowSizeClass"
description: "Window size classes are a set of opinionated viewport breakpoints to design, develop, and test
responsive application layouts against. For more details check Support different screen sizes documentation.

WindowSizeClass contains a [WindowWidthSizeClass] and [WindowHeightSizeClass], representing the
window size classes for this window's width and height respectively.

See [calculateWindowSizeClass] to calculate the WindowSizeClass for an Activity's current window"
type: "class"
---

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


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
class WindowSizeClass
private constructor(
    val widthSizeClass: WindowWidthSizeClass,
    val heightSizeClass: WindowHeightSizeClass,
)
```


Window size classes are a set of opinionated viewport breakpoints to design, develop, and test
responsive application layouts against. For more details check <a
href="https://developer.android.com/guide/topics/large-screens/support-different-screen-sizes"
class="external" target="_blank">Support different screen sizes</a> documentation.

WindowSizeClass contains a `WindowWidthSizeClass` and `WindowHeightSizeClass`, representing the
window size classes for this window's width and height respectively.

See `calculateWindowSizeClass` to calculate the WindowSizeClass for an Activity's current window


## Companion Object

#### Methods

<div class='sourceset sourceset-common'>Common</div>


```kotlin
@ExperimentalMaterial3WindowSizeClassApi
        
        fun calculateFromSize(
            size: DpSize,
            supportedWidthSizeClasses: Set<WindowWidthSizeClass> =
                WindowWidthSizeClass.DefaultSizeClasses,
            supportedHeightSizeClasses: Set<WindowHeightSizeClass> =
                WindowHeightSizeClass.DefaultSizeClasses,
        ): WindowSizeClass
```


Calculates the best matched `WindowSizeClass` for a given `size` according to the
provided `supportedWidthSizeClasses` and `supportedHeightSizeClasses`.

#### Parameters

| | |
| --- | --- |
| size | of the window |
| supportedWidthSizeClasses | the set of width size classes that are supported |
| supportedHeightSizeClasses | the set of height size classes that are supported |


#### Returns

| | |
| --- | --- |
|  | `WindowSizeClass` corresponding to the given width and height |






