Window Size Class — what it is, size classes and development

Author: IT Sectr Published: 2026-06-08 Reading time: 9 min

Window Size Class is an API from Jetpack WindowManager that divides the application window into three categories: Compact, Medium and Expanded. Instead of checking physical resolution or pixel density, the classes analyze the available width in dp — this gives a predictable result on any device. According to Android Developers Documentation (2025), Window Size Class has become the standard for adaptive interfaces in Jetpack Compose and View system thanks to WindowManager.

Key Takeaways

  • Window Size Class — API for categorizing window width into Compact, Medium and Expanded.
  • Compact — class for narrow windows up to 600 dp, typical for phones in portrait mode.
  • Medium — class for windows 600–840 dp, characteristic for tablets in portrait and phones in landscape.
  • Expanded — class for wide windows from 840 dp, found on tablets and desktop.
  • Material Design 3 uses Window Size Class as the basis for adaptive layout.

What is Window Size Class?

Window Size Class is an Android platform API included in the Jetpack WindowManager library that classifies the available application window space into three categories. Unlike the traditional approach with resource qualifiers (small/large/xlarge), Window Size Class provides a discrete set of values that a developer can rely on when designing an interface.

The API appeared in Android 7.0 Nougat as part of multi-window mode support, but active adoption began with Jetpack WindowManager 1.1 (2022). Google recommends Window Size Class as the primary tool for building adaptive layouts instead of checking screen width through Display.getSize().

Classification is based on window width in dp, not physical size or pixel density. This means that two devices with different resolutions but the same width in dp will receive the same class — the interface will be predictably identical.

Three Android window size classes

Compact — class for windows up to 600 dp wide. Phone in portrait mode, most foldables (Galaxy Z Flip) in folded state. The interface is built in one column, navigation via Bottom Navigation.

Medium — class for windows 600–840 dp wide. Tablet in portrait, phone in landscape, foldable device in half-open state. The interface uses two columns — for example, a list on the left and details on the right. Navigation Rail replaces Bottom Navigation.

Expanded — class for windows from 840 dp wide. Tablet in landscape, desktop window, foldable device in unfolded state. The interface can use three or more panels, Permanent Navigation Drawer, tool panels.

In Material Design 3, adaptive components are defined for each class: Navigation Rail for Medium, Navigation Drawer for Expanded, Bottom Navigation for Compact. The developer does not need to select breakpoints — they are already defined by the API.

How Window Size Class works

Window Size Class is calculated based on the current width of the application window in dp, taking into account system elements — status bar, navigation bar, screen split in Split Screen mode. The API triggers when the window configuration changes: device rotation, entering multi-window mode, unfolding a foldable device.

To obtain the class, the WindowSizeClass from the androidx.window library is used. The developer subscribes to a Flow (Kotlin) or LiveData (Java) that automatically updates the class with every window size change — without manual onConfigurationChanged handling.

Classification happens in three steps. First — measuring the current window width in pixels. Second — converting to dp via DisplayMetrics.density. Third — comparing the obtained value with thresholds: less than 600 dp — Compact, 600–840 — Medium, from 840 — Expanded.

kotlin
val windowSizeClass = currentWindowAdaptiveInfo().windowSizeClass()

when (windowSizeClass.windowWidthSizeClass) {
    WindowWidthSizeClass.COMPACT -> // compact width
    WindowWidthSizeClass.MEDIUM  -> // medium width
    WindowWidthSizeClass.EXPANDED -> // expanded width
}

In addition to width (windowWidthSizeClass), the API provides a class for window height (windowHeightSizeClass) — useful for landscape orientation and desktop windows.

Window Size Class in Jetpack Compose

In Jetpack Compose, Window Size Class is used through the currentWindowAdaptiveInfo() function, which returns WindowAdaptiveInfo with width and height classes. This function takes into account not only the window size but also the input type (keyboard, mouse, touch) — through WindowPosture and WindowLayoutInfo.

A typical scenario is switching between layouts depending on the class. For example, on Compact a BottomSheet with selection is displayed, on Medium — a side panel, on Expanded — a permanent Navigation Drawer.

kotlin
@Composable
fun AdaptiveNavigation(windowSizeClass: WindowWidthSizeClass) {
    when (windowSizeClass) {
        WindowWidthSizeClass.COMPACT -> BottomNavigation()
        WindowWidthSizeClass.MEDIUM  -> NavigationRail()
        WindowWidthSizeClass.EXPANDED -> NavigationDrawer()
    }
}

In Material Design 3, NavigationSuiteScaffold components automatically adapt to Window Size Class — the developer does not need to write conditional logic.

Window Size Class and Material Design 3

Material Design 3 (Material You) is fully integrated with Window Size Class. The adaptive layout system in Material 3 determines which navigation component to use for each class: BottomNavigation for Compact, NavigationRail for Medium, NavigationDrawer for Expanded.

This integration works at the Adaptive API level, which combines Window Size Class with other signals — FoldState (foldable device) and WindowPosture (screen position). Adaptive API is available through the material3-adaptive library.

Material 3 provides four adaptive top-level components: ListDetailPaneScaffold, SupportingPaneScaffold, NavigationSuiteScaffold and AdaptiveSheet. Each of them changes its behavior depending on Window Size Class without additional configuration.

ClassNavigation ComponentPane Scaffold
CompactBottom NavigationHidden pane
MediumNavigation RailSliding pane
ExpandedNavigation DrawerPermanent pane

Benefits of adaptive layouts

Using Window Size Class provides three key advantages in mobile development. First — predictability: instead of hundreds of screen size combinations, the developer works with three classes. This radically reduces the number of test scenarios and bugs related to layout.

Second — automatic adaptation to multi-window mode. When the user enters Split Screen, the window width changes — Window Size Class recalculates instantly, and the interface adapts. Without this API, the app in split screen shows a stripped-down phone interface version.

Third — consistency with Material Design 3. Google has built Window Size Class into the adaptive component system, so interfaces built on Material 3 automatically follow Google's large screen design recommendations without extra work.

Frequently Asked Questions

How is Window Size Class different from Screen Size Buckets?

Screen Size Buckets (small/large/xlarge) is an outdated approach from Android 1.6–6.0 based on the physical screen size. Window Size Class focuses on the available window width in dp and works in real time when the window size changes.

Is it necessary to support Window Size Class on Android 6 and below?

Window Size Class is available through Jetpack WindowManager on Android 7.0+ with a backport library. For Android 6 and below — only Compact, since multi-window is absent. Use fallback via WindowMetrics.

How does Window Size Class work on foldable devices?

When unfolding the device, the window width changes and Window Size Class recalculates automatically. The class can change from Compact to Expanded due to the increase of the available area.

Can Window Size Class be used in XML layout (Views)?

Yes, through WindowManager in Activity or Fragment. After obtaining WindowSizeClass, use conditional logic to switch between XML layouts or change View visibility.

What thresholds are used for WindowHeightSizeClass?

For window height, the thresholds differ: Compact — up to 480 dp, Medium — 480–900 dp, Expanded — from 900 dp. WindowHeightSizeClass is useful in landscape orientation and on desktop.

Summary

  • Window Size Class — Jetpack WindowManager API for categorizing window width into Compact, Medium and Expanded.
  • Compact — up to 600 dp, single-column interface, Bottom Navigation.
  • Medium — 600–840 dp, two-column interface, Navigation Rail.
  • Expanded — from 840 dp, multi-panel interface, Navigation Drawer.
  • Jetpack Compose — currentWindowAdaptiveInfo() function to obtain the class at runtime.
  • Material Design 3 — adaptive components automatically react to Window Size Class.
  • Conclusion — Window Size Class replaces traditional breakpoint-based adaptation and makes interfaces predictable on all devices.

We will develop a mobile application turnkey

IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.

Discuss the project

Read also