Miss any of our Open RFC calls?Watch the recordings here! »

use-lang-direction

0.1.11 • Public • Published

use-lang-direction

A React hook that reads the HTML element's dir attribute value and any updates to that value allowing you to update your UI accordingly.

In Action

CodeSandbox Demo

Basic Usage

import React from "react";
import { useLangDirection } from "use-lang-direction";
 
const App = () => {
  const langDir = useLangDirection();
 
  return (
    <div >
      <input dir={langDir} type="text" />
    </div>
  );
};
 

License

MIT

Install

npm i use-lang-direction

DownloadsWeekly Downloads

1,883

Version

0.1.11

License

MIT

Unpacked Size

7.4 kB

Total Files

4

Last publish

Collaborators

  • avatar