react-moon-toggle
Toggle dark mode (or anything) in moon phases emoji
Usage
;; const app = { const dark setDark = React; return <Toggle ... dark setDark />;};
Installation
$ yarn add react-moon-toggle
Props
-
dark
boolean (required) -
setDark
=(newDark: boolean) => null
?function -
interval
=50
number -
darkIndex
=0
number (0-7) -
lightIndex
=4
number (0-7) -
peekOnHover
=true
boolean
phases array used for indexes:
const phases = "🌑" "🌒" "🌓" "🌔" "🌕" "🌖" "🌗" "🌘";
phases array used for indexes:
const phases = "🌑" "🌒" "🌓" "🌔" "🌕" "🌖" "🌗" "🌘";
Any other props will be given directly to the <button>
element.
License
MIT