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.
Import
import { Direction } from "@tarve/core";Usage
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
| Prop | Type | Default |
|---|---|---|
dir | "ltr" | "rtl" | "ltr" |
gap | number | 0 |
orientation | "horizontal" | "vertical" | "horizontal" |
Common props
Shared by every component. See descriptions →
childrenclassclassNamehighlightidkeymotionFromonHighlightonPasteonPointerLeaveonPointerMoveonSizeonTransitionEndrovingGroupstyle