1.2.1 • Published 6 years ago
react-darkmode-toggler v1.2.1
react-darkmode-toggler

Made with create-react-library
Demo
Install
npm i react-darkmode-toggleror
yarn add react-darkmode-togglerUsage
import React, { useState } from 'react'
import { DarkModeToggler } from 'react-darkmode-toggler'
const App = () => {
const [isDark, setIsDark] = useState<'light' | 'dark'>('light')
// button toggler
const darkModeHandler = () => {
setIsDark(isDark === 'light' ? 'dark' : 'light')
}
return (
<DarkModeToggler
size='small'
isDark={isDark}
onClick={darkModeHandler}
border='#000'
/>
)
}
Props
| Props | Types | Default | Required |
| ------- | ------------------- | ------- | -------- |
| isDark | `light` or `dark` | 'light' | no |
| onClick | func | null | yes |
| size | `middle` or `small` | no | no |
| border | hex color | #000 | no |License
1.2.0
6 years ago
1.1.8
6 years ago
1.2.1
6 years ago
1.1.7
6 years ago
1.1.6
6 years ago
1.1.5
6 years ago
1.1.4
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago