datui
Color scheme

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 inert during 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.

PropTypeDefaultDescription
activeView (required)string—Id of the `View` to show.
childrenReactNode—`View`s with unique `id`s.
classNamestring—
onTransition((event: NavTransitionEvent) => void)—Fires once each transition has finished. Going to an earlier child counts as back.