Direction
Re-exports the Base UI DirectionProvider for RTL support, so every SevenUI primitive below it follows right-to-left layouts.
Installation
Bash
Usage
This module is a direct re-export of
@base-ui/react/direction-provider.
The provider makes Base UI components (menus, sliders, popovers, …)
behave directionally, but it does not flip your layout: you must also
set dir="rtl" (or the CSS direction) on the surrounding DOM
yourself, as in the example above. Wrap it around the whole app or just
the subtree that needs it.
API reference
DirectionProvider
| Prop | Type | Default |
|---|---|---|
direction | "ltr" | "rtl" | "ltr" |
useDirection
Hook returning the current text direction from the nearest provider —
useful in portaled components that render outside the dir-attributed
DOM subtree.