@lazy-react/prefers-light-mode
TypeScript icon, indicating that this package has built-in type declarations

1.0.16 • Public • Published

README.md

detect if the user has requested the system use a light or dark color theme.

install

yarn add @lazy-react/prefers-light-mode
yarn-tool add @lazy-react/prefers-light-mode
yt add @lazy-react/prefers-light-mode
import React, { useState } from 'react'
import App, { Container } from 'next/app';
import PrefersLightMode from '@lazy-react/prefers-light-mode/component';
import CssBaseline from '@material-ui/core/CssBaseline';

export default class MyApp extends App
{
	render()
	{
		const { Component, pageProps } = this.props;
		return (
			<React.StrictMode>
				<PrefersLightMode key="PrefersLightMode">
					<CssBaseline />
					<Component {...pageProps} />
				</PrefersLightMode>
			</React.StrictMode>
		)
	}
}

Package Sidebar

Install

npm i @lazy-react/prefers-light-mode

Weekly Downloads

3

Version

1.0.16

License

ISC

Unpacked Size

21.7 kB

Total Files

20

Last publish

Collaborators

  • bluelovers