Skip to content

davidicus/use-lang-direction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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.

Resources

Stars

Watchers

Forks

Packages

No packages published