Skip to main content
TextDirectionProvider supplies ltr or rtl direction to Twenty UI controls. It does not render a DOM element or set an HTML dir attribute. Set both the provider direction and the matching document direction.

Usage

The host application supplies translated labels and chooses the direction. Direction context affects directional interactions; the HTML attribute handles text and layout. For example, SegmentedControl reverses horizontal arrow navigation, and ResizeHandle reverses horizontal resizing.

Scope and state

Place one provider around the controls that share a direction. Nested providers can override the direction for a subtree; pair each override with a matching dir attribute. direction is a required application-owned prop, with no uncontrolled mode. The provider does not translate content or choose direction from the locale automatically.

Props

ReactNode
required
Controls that receive the direction context.
"ltr" | "rtl"
required
Reading direction used by directional interactions. Also set the matching HTML dir attribute on the content.