0.0.6 • Published 11 months ago

next-day-theme-toggle v0.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

$ npm install -s next-day-theme-toggle

Using yarn:

$ yarn install -s next-day-theme-toggle

Use the component DayNightToggle to display a nice toggle in your header or somewhere else. We will be allowing you to choose different style versions of the toggle in next versions.

Beware to wrap the component in a div, the toggle will take 100% of its parent width.

Also give it those two props : {theme, setTheme}, to make sure that the toggle can change your theme context

import React, {useContext} from 'react';
import DayNightToggle from "react-day-theme-toggle/";
import ThemeContext from "./contexts/ThemeContext"

const Header = () => {
    
    const {theme, setTheme} = useContext(ThemeContext)
    
    return (
        <div>
            <DayNightToggle style={"classic"} theme={theme} setTheme={setTheme}/>
        </div>
    );
};

export default Header;

image image 2023-05-30-14-55-42

image image 2023-05-31-11-13-43

image image 2023-06-01 15-53-13

image image 2023-06-02 10-10-04

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago