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