About
A LTR/RTL direction context provider that sets reading order and text direction for a layout, optionally auto-detecting it from a BCP 47 language tag.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Direction to your project and fits it to your theme.
Code
How Direction is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import { Direction } from "@/components/ui/direction";
export default function DirectionDemo() {
return (
<div className="flex w-full items-center justify-center p-10">
<Direction direction="rtl">
<div className="flex w-full max-w-sm flex-col gap-2 rounded-xl border border-border bg-surface p-6 text-foreground">
<p className="text-sm text-muted-foreground">مرحبا بالعالم</p>
<p className="text-base">This content flows right-to-left.</p>
</div>
</Direction>
</div>
);
}








