Direction

Switches a subtree between left-to-right and right-to-left flow.

Layout direction helper. RTL reverses visual horizontal flow while preserving logical/focus order. Text bidi is not changed.

Direction rendered by Tarve Direction rendered by Tarve
Native render. The live version loads when this comes into view.

Import

import { Direction } from "@tarve/core";

Usage

Direction.tsx
import { Badge, Column, Direction, Text, theme } from "@tarve/core";

<Column gap={12}>
  <Direction dir="ltr" gap={8}>
    <Badge>1</Badge>
    <Badge variant="secondary">2</Badge>
    <Badge variant="outline">3</Badge>
    <Text color={theme.colors.mutedForeground}>dir="ltr"</Text>
  </Direction>
  <Direction dir="rtl" gap={8}>
    <Badge>1</Badge>
    <Badge variant="secondary">2</Badge>
    <Badge variant="outline">3</Badge>
    <Text color={theme.colors.mutedForeground}>dir="rtl"</Text>
  </Direction>
</Column>

Props

PropTypeDefault
dir "ltr" | "rtl""ltr"
gap number0
orientation "horizontal" | "vertical""horizontal"

Common props

Shared by every component. See descriptions →

childrenclassclassNamehighlightidkeymotionFromonHighlightonPasteonPointerLeaveonPointerMoveonSizeonTransitionEndrovingGroupstyle