use-change-theme

1.0.2 • Public • Published

useChangeTheme

Description

This versatile hook empowers you to effortlessly establish an initial theme for your application and seamlessly transition between various themes, including light and dark modes. With useCustomTheme, you have the freedom to specify background colors, font colors, and border colors for both the initial theme and any new themes you create. Customize your app's appearance like never before and provide users with a tailored visual experience that suits your application's unique style and branding.

REACT SAMPLE CODE

REACT NATIVE SAMPLE CODE

Steps to use this hook include: run:

npm install use-change-theme

- import useChangeTheme into your app component where you want to use it
- access the background color, fontColor and border color props embedded.

**see sample usage below**

**USAGE IN REACT**


  
```javascript
import React from 'react';
import useChangeTheme from "use-change-theme";

function ThemeUsage() {
  const { backgroundColor, fontColor, borderColor, toggleColors } = useChangeTheme('#cddded', '#ff05ff', ' #00FF00');

  return (
    <div style={{ backgroundColor, color: fontColor, border: "2px solid green", borderColor: borderColor }}>
      <h1>Themed App</h1>
      <button onClick={() => toggleColors('#808080', '#ff5' , '#000000')}>
        Toggle Colors
      </button>
    </div>
  );
}

export default ThemeUsage;

Package Sidebar

Install

npm i use-change-theme

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

3.88 kB

Total Files

3

Last publish

Collaborators

  • aamanuels