Direction
Provides right-to-left (RTL) text direction context for Arabic, Hebrew, and other RTL interfaces so Slider, Switch, and Base UI controls mirror automatically.
Fully compatible with the standard shadcn/ui API, re-exporting DirectionProvider and useDirection() directly from @base-ui/react. Wrapping a subtree with DirectionProvider (alongside matching dir="rtl" on the container) automatically mirrors Base UI interactions—such as Slider filling from the right and reversing arrow keys, and Switch flipping layout direction. Logical CSS properties (ms-*, me-*, start-*, end-*) are used throughout the library for accurate RTL alignment.
Installation (Shadcn Registry)
npx shadcn@latest add @apple-liquid/directionUsage
import { DirectionProvider } from '@/components/ui/direction';
import { Slider } from '@/components/ui/slider';
export function Example() {
return (
<DirectionProvider direction="rtl">
<div dir="rtl">
<Slider defaultValue={60} aria-label="المستوى" />
</div>
</DirectionProvider>
);
}Props API
DirectionProvider
| Prop | Type | Default | Description |
|---|---|---|---|
direction | 'ltr' | 'rtl' | 'ltr' | Text direction for the wrapped subtree |
useDirection() returns the active direction for custom components.
Dialog
Apple Liquid Glass centered dialog with unified desktop and mobile modal presentation, a built-in maximize-to-fullscreen toggle, and fixed header/footer layout with scrollable body.
Drawer
Gesture-driven drawer built to iOS 27 edge-hugging rounded Liquid Glass guidelines, supporting four-way swipe edges, multi-step Snap Points, and isolated-layer SDF optical refraction.