Appica UIUI 1.0.0

Direction Provider

Set the LTR or RTL reading direction.


DirectionProvider sets the reading direction for descendant components. It's a thin wrapper over Base UI's direction provider, so your app depends on @appica/ui-react rather than the underlying primitive.

Usage

Wrap your app at its root and set dir. For full RTL support, also set the dir attribute on <html> so CSS logical properties and native text flow resolve correctly — see Right-to-Left (RTL). The example uses Next.js's root layout; for the equivalent root file in other frameworks, see the Framework notes in Installation.

app/layout.tsx (Next.js)

Descendant components read the value via useDirection. Components that position elements with JavaScript — Slider, Switch, Carousel, and overlays like menus — rely on it to know which side is "end."

Props

© 2026 Appica UI. A free component library, crafted by the Appica team.