Wensity Labs

Direction

Component

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>
  );
}

Dependencies

More by Wensity Labs

View all
  • Sidebar

    Sidebar

    231
  • Calendar

    Calendar

    171
  • Button

    Button

    76
  • Color Picker

    Color Picker

    62
  • Image Comparison Slider

    Image Comparison Slider

    55
  • AI Prompt Input

    AI Prompt Input

    50
  • Navigation Menu

    Navigation Menu

    36
  • Text Morphing

    Text Morphing

    35