theme-wrapper
v1.0.0
Published
Theme wrapper component for Mathsy applications
Maintainers
Readme
Theme Wrapper
A React component for managing theme switching in Mathsy applications.
Installation
npm install theme-wrapper
# or
yarn add theme-wrapperUsage
import ThemeWrapper, { useThemeWrapper } from 'theme-wrapper';
// Using the hook
function MyComponent() {
const { mode, config, toggle } = useThemeWrapper('light');
return (
<div>
<button onClick={toggle}>Toggle Theme</button>
<p>Current theme: {mode}</p>
</div>
);
}
// Using the wrapper component
function App() {
return (
<ThemeWrapper mode="light">
<MyComponent />
</ThemeWrapper>
);
}Available Exports
ThemeWrapper: The main component for wrapping your app with theme supportuseThemeWrapper: A hook for managing theme state and togglingThemeMode: Type definition for theme modes ('light' | 'dark')
Development
- Clone the repository
- Install dependencies:
yarn install - Build the package:
yarn build
License
MIT
