Providers & app
AdaptivityProvider
Exposes viewport size classes and input capabilities via useAdaptivity(). Values are detected from media queries; the provider overrides them for a subtree.
import { AdaptivityProvider } from "datui";Examples
Detected values
Resize the window to see sizeX switch at the tablet breakpoint (768px).
- viewWidth
- desktop
- sizeX
- regular
- sizeY
- compact
- hasPointer
- true
- hasHover
- true
- isDesktop
- true
Forcing a size class
sizeX: compact, sizeY: regular
Accessibility
- Has no DOM output. Components use it to choose structure, e.g. a bottom sheet on compact widths and a dialog on regular widths.
API
AdaptivityProvider
Overrides detected adaptivity values for a subtree. Unset values keep being detected from media queries.
| Prop | Type | Default | Description |
|---|---|---|---|
| hasHover | boolean | — | |
| hasPointer | boolean | — | |
| sizeX | SizeType | — | Horizontal size: `compact` below the tablet breakpoint. Drives structural changes (sheet vs dialog). |
| sizeY | SizeType | — | Vertical density: `compact` for wide layouts operated by a fine pointer. |
| viewWidth | ViewWidth | — |