Providers & app
AppRoot
Root container that applies theme, density, direction and locale to the DOM and hosts the portal layer overlays render into.
import { AppRoot, Portal } from "datui";Examples
Setup
An embedded, dark, compact-density datui root.
Accessibility
- Sets
langanddirfromConfigProviderso assistive technology reads content correctly. - Overlays portal into AppRoot's layer instead of
document.body, so they inherit the theme while Radix still manages focus andaria-hiddenon the rest of the page.
API
AppRoot
Root container for datui apps. Applies theme, density, direction and locale to the DOM and hosts the portal layer that overlays render into.
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | |
| density | "compact" | "regular" | — | Force a density instead of deriving it from the viewport and pointer. |
| mode | "full" | "embedded" | full | `full` fills the viewport and owns page scroll; `embedded` lives inside an existing page and contains its own scroll and overlays. |
Portal
| Prop | Type | Default | Description |
|---|---|---|---|
| container | HTMLElement | — | |
| disabled | boolean | — | Render in place instead of portalling. |