Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ufukbakan/color-scheme-hook

Color scheme hook for React
https://github.com/ufukbakan/color-scheme-hook

javascript npm react reactjs typescript

Last synced: 4 days ago
JSON representation

Color scheme hook for React

Awesome Lists containing this project

README

        

color-scheme-hook







Returns the system's preferred scheme by default. It's going to be overridden when toggled.

## Installation
```bash
npm install color-scheme-hook
```

## Usage
```jsx
import { useDarkMode, useLightMode } from "color-scheme-hook";

export default function MyReactComponent(){
const [isDarkMode, toggleColorScheme, resetPreference] = useDarkMode();
const [isLightMode, toggleColorScheme, resetPreference] = useLightMode();
}
```