1.0.2 • Published 1 year ago

react-themes-button-switch v1.0.2

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

React Theme switch button

The Theme switch button component is highly configurable, allowing developers to customize its appearance, behavior, and animations. The component provides callbacks for handling theme changes, allowing developers to update their application's theme accordingly.

Demo

Alt Text

Installation

Install my-project with npm

  npm install react-themes-button-switch
 

Usage/Examples

import React from 'react';
import {ThemeSwitchButton} from 'react-themes-button-switch';

function App() {
  return <ThemeSwitchButton size="normal"   />
}

Features

  • Light/dark mode toggle
  • Live previews
  • Fullscreen mode
  • Cross platform

API Reference

Properties

These should be defined on the JSX node, many cannot be changed once they have been set without recreating the node.

NameTypeDefaultvaluesDescription
sizestring"small""small","normal","large"Size of the switch
moonColorstring"white""red","black","#77b5fe",etc..Color of the moon in dark mode
sunColorstring"yellow""red","black","#77b5fe",etc..Color of the sun in light mode
onThemeChangefunctionundefinedonThemeChange(mode)=>{..}Get the values of which mode is selected.

Authors

License

MIT