1.0.5 • Published 1 year ago

switch-mode v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

This is a custom react component that allows developers to add a toggle theme functionality in their projects seamlessly with its value persisted over the localStorage. Here, with the aid of react context API, values of props are able to be passed down to the specific components that need the required data.

How to Install:

App.js

import React from "react"; import { useTheme, ToggleSwitch } from "switch-mode";

function App() { const { theme } = useTheme(); return (

 <ToggleSwitch />
 <h2> Some text here** </h2>
 <Main>
   `switch-mode` is a custom component used in react for enhancing user
   interfaces with dark/light themes
 </Main>
 <small>Created by Israel Abazie on February 22, 2023</small>

export default App;

Index.js

import React from 'react'; import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; import {ThemeProvider} from "switch-mode";

const root = ReactDOM.createRoot(document.getElementById('root')); root.render( <React.StrictMode> </React.StrictMode> );

// If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log)) // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals reportWebVitals();

If you are encountering bugs, send your queries: https://github.com/vintage-creator/switch-mode/issues

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago