@rasenganjs/theme
v1.0.1
Published
Library that handles themes for Rasengan.JS applications
Readme
Rasengan Theme
Simple Rasengan.JS package to manage the theme of your application.
Installation
You can install the @rasenganjs/theme package by using the following command:
npm install @rasenganjs/themeor
yarn add @rasenganjs/themeUsage
Here is an example of how you can use the @rasenganjs/theme package:
Wrap your application with ThemeProvider
import { type AppProps } from 'rasengan';
import AppRouter from '@app/app.router';
import ThemeProvider from '@rasenganjs/theme';
export default function App({ Component, children }: AppProps) {
return (
<ThemeProvider>
<Component router={AppRouter}>{children}</Component>
</ThemeProvider>
);
}Use the useTheme hook to get the current theme
import { useTheme } from '@rasenganjs/theme';
const Card = () => {
const { theme, actualTheme, setTheme, isDark } = useTheme();
return <div>{/* Code here */}</div>;
};| Property | Type | Description | Values |
| ------------- | ------------------------- | ----------------------------------------------------- | ----------------------------- |
| theme | string | The current theme | light or dark or system |
| actualTheme | string | The actual theme | light or dark |
| setTheme | (theme: string) => void | A function to set the theme | - |
| isDark | boolean | A boolean that indicates if the current theme is dark | true or false |
Community
The Rasengan.js community can be found on GitHub Discussions where you can ask questions, voice ideas, and share your projects with other people.
We also have a Twitter account where you can follow us to get the latest news about Rasengan.js.
License
Rasengan.js is MIT licensed.
Authors
Here is the authors list:
- Dilane Kombou (@dilanekombou)
