Navigation
Root
Top-level stack of Views. Shows one at a time and slides between them — a later child counts as forward, an earlier one as back.
import { Root } from "datui";Examples
Switching views
App
Accessibility
- Only the active view is rendered; the outgoing one is
inertduring the animation and loses focus immediately. - After the transition, focus moves to the incoming view's panel title when focus was inside the root.
- Scroll position of a view is saved when leaving and restored when coming back.
- Respects reduced motion and
ConfigProvider transitionMotionEnabled.
API
Root
Top-level stack of `View`s. Shows only `activeView`; switching slides forward (later child) or back (earlier child), restores scroll on back and focuses the incoming view's panel title.
| Prop | Type | Default | Description |
|---|---|---|---|
| activeView (required) | string | — | Id of the `View` to show. |
| children | ReactNode | — | `View`s with unique `id`s. |
| className | string | — | |
| onTransition | ((event: NavTransitionEvent) => void) | — | Fires once each transition has finished. Going to an earlier child counts as back. |