Skip to content

souryadeepRC/react-web-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Web Theme

React Web Theme is a simple and customizable component to handle theme in web applications created using React.

Version

image image image

Implemented Technologies

image image

Compatible With

  • React >=16.8.0
  • Typescript

Installation

You can install React Web Theme via npm:

  npm install react-web-theme

Usage

To use React Web Theme in your React application, follow these steps:

Import the ThemeProvider component and wrap your parent element with this:

return (
  <ThemeProvider>
    <App />
  </ThemeProvider>
);

Inside any child component you can call useAppTheme method to get the latest selected theme name in appTheme variable.

const appTheme: AppTheme = useAppTheme();

AppTheme will consist any of these three value

Possible values of App theme

  • light
  • dark
  • default

the selected theme value will be stored in local storage as well in the name of react-web-theme-value

react-web-theme-value | light;

Inside any child component you can call ThemeSwitch component with following parameters to get Theme changing Switch UI.

<ThemeSwitch />
  • You can provide some customize onChange Function to the component which will get executed along with theme change.
<ToggleSwitch onChange={toggleTheme} />
  • If you want to customize from default styles you can pass css class to parent HTML element and alter like below:
<ToggleSwitch className="custom_style" onChange={toggleTheme} />

Author

Acknowledgements

🚀 About Me

I'm a Experienced Frontend software engineer with 7+ years of hands-on and analytical skills in ReactJS and JavaScript, Restful API. Skilled in designing, developing, and deploying web applications. Proficient in building responsive, performant, and accessible user interfaces. Strong problem-solving and teamwork abilities.

About

React Web Theme is a simple and customizable component to handle theme in web applications created using React.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published