Skip to content
GitHub11 stars

Enables right-to-left behavior for the primitives.

<div dir="rtl">
    <DirectionProvider Direction="TextDirection.Rtl">
        <SliderRoot Value="25">

DirectionProvider tells the components inside it the reading direction. It renders no element and sets no dir attribute, so set dir="rtl" on an element yourself for the layout.

Arrow keys, pointer dragging and logical placement (InlineStart, InlineEnd) run in the browser and read the computed CSS direction, so dir="rtl" is enough for them. The provider is for what's decided while rendering, where there's no CSS to read: the physical data-activation-direction of Tabs and Navigation Menu.

Anatomy

@using Blazix.Primitives

<div dir="rtl">
    <DirectionProvider Direction="TextDirection.Rtl">
        ...
    </DirectionProvider>
</div>

API Reference

DirectionProvider

Doesn't render its own HTML element.

ParameterTypeDefault
Direction TextDirection TextDirection.Ltr
ChildContent

The part's content.

RenderFragment? -