Skip to content

Direction

Runtime LTR / RTL — document dir and persisted preference.

@xngui/cdk/direction
@xngui/cdk/direction

Preview

Document dir: ltr

Start aligns to the reading edge — layout mirrors with direction.

Items: 1 · 2 · 3

Assistive:
TipSR
import { XDirectionService } from '@xngui/cdk/direction';
 
const direction = inject(XDirectionService);
 
direction.setDirection('rtl');
direction.toggle();
 
// document.documentElement dir stays in sync and preference is persisted

Events

Interact with the preview — events will appear here.