Skip to main content

Adaptive layout

The provider measures the environment and shares it, so your screens and the theme's adaptive rules can react to it.

PartValues
Window size classCompact (under 600 dp), Medium (600), Expanded (840), Large (1200)
InputTouch, or Pointer for a mouse and trackpad (hover, denser UI)
PlatformAndroid, iOS, macOS, Windows, Linux, Web
Capabilitieswhat the device supports (for example hover)

The breakpoints are the Material window size classes by default, and a brand can move them in its theme.

CamoEnvironment has windowSize, input, platform and capabilities. Use the window size class to choose between a navigation bar, a rail and a drawer for the same destinations.

// Set it yourself, for example in a preview or a test:
CamouflageProvider(skin = MaterialSkin, theme = materialTheme(), environment = myEnvironment) { App() }

See CamoNavigationBar, CamoNavigationRail and CamoNavigationDrawer for one set of destinations in all three forms.