1.0.8 • Published 1 year ago

tailwind-theme-toggle-buttons v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago
npm install tailwind-theme-toggle-buttons

or

yarn add tailwind-theme-toggle-buttons

Usage

Step 1.

tailwind.config.js

module.exports = {
  darkMode: "class",
  // others
};

Step 2.

import Toggle from "tailwind-theme-toggle-buttons";

export default function App() {
  return (
    <div>
      // button style 1
      <Toggle style="A" />

      // button style 2
      <Toggle style="B" />

      // button style 3
      <Toggle style="C" />
    </div>
  );
}

OR You can use your custom button

import { toggleFunc } from "tailwind-theme-toggle-buttons";

export default function App() {
  return (
    <div>
      <button onClick={toggleFunc}>Toggle</button>
    </div>
  );
}

Also you can check theme

const theme = localStorage.getItem("theme");
const isDark = theme === "dark";
1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago