Globalization in Blazor Numeric TextBox Component

26 Jun 20261 minute to read

The Blazor NumericTextBox component can be localized. Refer to Blazor Localization topic to localize Blazor components.

Right to Left

RTL provides an option to switch the text direction and layout of the NumericTextBox component from right to left. It improves the user experiences and accessibility for users who use right-to-left languages (Arabic, Urdu, etc.). To enable RTL NumericTextBox, set the EnableRtl to true.

The following code example initializes the Numeric TextBox in Chinese culture.

@using Syncfusion.Blazor.Inputs
@inject HttpClient Http

<SfNumericTextBox TValue="int?" Value=10 Locale="zh" EnableRtl="true"></SfNumericTextBox>

@code {
    [Inject]
    protected IJSRuntime JsRuntime { get; set; }
    protected override async Task OnInitializedAsync()
    {
        this.JsRuntime.Sf().LoadLocaleData(await Http.GetJsonAsync<object>("blazor-locale/src/zh.json")).SetCulture("zh");
    }
}

Right to Left in Blazor Numeric TextBox