React theme switcher component
A react theme switcher component
Installation
# using yarn yarn add react-theme-switcher # using npm npm install react-theme-switcher
Usage
By default theme switcher is applied to body and colors are already setted
;; { return <div className="App"> <header className="App-header"> <ThemeSwitcher /> <h2>React theme switcher</h2> </header> </div> ;} ;
Props you can pass to the component:
<ThemeSwitcher cssSelector="body" switcherColor="#2775cc" darkColor="#282c34" lightColor="#ffffff" lightTextColor="#272b33" darkTextColor="#ffffff"/>
Demo
Preview it on CodeSandbox https://codesandbox.io/s/6yr87ozmkk