Nifty Pony Merchandise

    TypeScript icon, indicating that this package has built-in type declarations

    1.8.0 • Public • Published


    A tool detecting if RTL scroll value should be negative.

    Build status NPM version NPM weekly downloads License Types definition Codacy Code Grade Tests LOC


    ❤️Please consider starring this project to show your love and support.🙌

    Working with RTL horizontal scrolling can be a bit frustrating because RTL scroll handling differs between browsers.
    Chrome scrollLeft value acts like there is no RTL al all, while FireFox and IE make scrollLeft a negative number.

    This tool gives you an answer should you reverse RTL scroll value in certain browser or not.


    npm install @xobotyi/should-reverse-rtl-scroll
    # or via yarn
    yarn add @xobotyi/should-reverse-rtl-scroll

    This lib is written in TypeScript and delivered with both, transpiled and untranspiled ES versions:

    • main field of package.json is pointing to transpiled ES5-compatible version with CJS modules resolution;
    • module field is pointing to transpiled ES5-compatible version with ES modules resolution;
    • esnext field is pointing to the ESnext version with ES modules resolution;

    you can add it directly to your site via the <script /> with help of UNPKG:

    <script src=""/>

    After that you will be able to use the function as xobotyi.shouldReverseRtlScroll()


    import { shouldReverseRtlScroll } from "@xobotyi/should-reverse-rtl-scroll";
    shouldReverseRtlScroll(); // true for FireFox, IE and false for Chrome or SSR
    // or undefined if to call it too early [read below]

    This function caches the value to bring the less possible performance impact. In case you want to get re-calculated value - pass true as first call parameter.

    Function will return undefined in case being called before the DOM is ready.

    Related projects

    • react-scrollbars-custom — The best React custom scrollbars component. Allows you to customise scrollbars as you like it, crossbrowser!
    • zoom-level — A comprehensive cross-browser package that allow you to determine page's and element's zoom level.
    • @xobotyi/scrollbar-width — A tool to get browser's scrollbars width.


    npm i @xobotyi/should-reverse-rtl-scroll

    DownloadsWeekly Downloads






    Unpacked Size

    22.6 kB

    Total Files


    Last publish


    • xobotyi