Components
Direction
A re-export of the Base UI direction provider for RTL and LTR layouts.
Direction is a thin re-export of the Base UI direction provider. It sets the text direction (LTR or RTL) for a subtree and exposes a useDirection hook to read the current value.
Installation
pnpm dlx shadcn@latest add https://faber-ui.vercel.app/r/direction.jsonUsage
"use client";
import {
DirectionProvider,
useDirection,
} from "@/components/ui/direction";
export default function Example() {
return (
<DirectionProvider dir="rtl">
<Content />
</DirectionProvider>
);
}
function Content() {
const direction = useDirection();
return <p>Current direction: {direction}</p>;
}API
Each part forwards every prop of what it is built on, including className and render where Base UI supports it. The props column lists only what Faber UI adds on top.
| Part | Built on | Props |
|---|---|---|
DirectionProvider | DirectionProviderBase UI | โ |
useDirection | useDirectionHook ยท Base UI | โ |
Last updated on