react-hook-dark-mode
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published
$ npm install react-hook-dark-mode

A React Hook to check whether the OS dark mode has been turned on.

example

import useIsDark from 'react-hook-dark-mode';
 
function App() {
  const isDark = useIsDark();
  return (
    <div className="App">
      <h1>Color scheme: {isDark ? "dark" : "light"}</h1>
    </div>
  );
}

Try it out here!

Readme

Keywords

Package Sidebar

Install

npm i react-hook-dark-mode

Weekly Downloads

1

Version

0.0.6

License

MIT

Unpacked Size

12.2 kB

Total Files

10

Last publish

Collaborators

  • peternoordijk