1.4.2 • Published 2 years ago

@qvgk/react-toggle-theme v1.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

About React Toggle Theme

React Toggle Theme was a React component originally created by forgng.

I saw that it had many issues that weren't getting fixed, so I decided to take it into my own hands and "reform" the module. I took out all packages that weren't needed, and fixed the ones that still remained. Then, I took the original code for the switch and put it here.

Oh, and I had to learn some TypeScript for this. You're welcome.

Installation

yarn add @qvgk/react-toggle-theme
npm install @qvgk/react-toggle-theme

Usage

import React, { useState } from "react"
import ToggleTheme from "@qvgk/react-toggle-theme"

export default function App() {
  const [currentTheme, setCurrentTheme] = useState("light")

  return (
    <div style={{ backgroundColor: currentTheme === "light" ? "#000" : "#fff" }}>
      <ToggleTheme selectedTheme={currentTheme} onChange={setCurrentTheme} />
    </div>
  )
}
1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.0

2 years ago