/react-use-color-mode

A react hook to detect dark or light mode of system

Primary LanguageTypeScript

react-use-color-mode 🌗

A react hook to detect dark or light mode of system

NPM JavaScript Style Guide

Install

npm install --save react-use-color-mode

Usage

import * as React from 'react';

import { useColorMode } from 'react-use-color-mode';

const Example = () => {
  const colorMode = useColorMode();
  return (
    <div>
      <h2>Your color Mode is {colorMode}</h2>
    </div>
  );
};

License

MIT © JasonHeylon