To switch an editor to a right-to-left representation, just enable a single property - "rtl". When this property is on, text flows from right to left in an editor and the editor itself is mirrored.

React MaskedInput: Right to Left Layout

The right to left support of React MaskedInput.

A live React example of jqxMaskedInput, the jQWidgets MaskedInput component, with its complete source code below. It is one of 4 jqxMaskedInput demos for React.

jqxMaskedInput API used in this demo

Source code

To run it in your own app, install the package with npm install jqwidgets-scripts, add these files to a Vite React and TypeScript project, and import jqx.base.css and a theme in main.tsx. Getting started with jqxMaskedInput shows the setup step by step.

App.tsx

import React from 'react';
import JqxMaskedInput from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxmaskedinput';

function App(): React.JSX.Element {
    return (
        <div style={{ fontSize: '13px', fontFamily: 'Verdana' }}>
            <div style={{ marginTop: '10px' }}>Numeric</div>
            <JqxMaskedInput theme="tailwind-blue-dark" width={250} height={25} rtl={true} />

            <div style={{ marginTop: '10px' }}>Zip Code</div>
            <JqxMaskedInput theme="tailwind-blue-dark" width={250} height={25} mask="#####-####" rtl={true} />

            <div style={{ marginTop: '10px' }}>SSN</div>
            <JqxMaskedInput theme="tailwind-blue-dark" width={250} height={25} mask="###-##-####" rtl={true} />

            <div style={{ marginTop: '10px' }}>Date</div>
            <JqxMaskedInput theme="tailwind-blue-dark" width={250} height={25} mask="##/##/####" rtl={true} />
        </div>
    );
}

export default App;

Learn more

More React MaskedInput demos