JSPM

sansiv-themes

1.0.3
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 6
    • Score
      100M100P100Q13262F
    • License MIT

    A React component for dynamic theming with dark mode, default themes, and custom themes.

    Package Exports

    • sansiv-themes

    Readme

    Sansiv Themes

    Sansiv Themes is a React component for dynamic theming with support for dark mode, default themes, and custom themes. It allows users to easily integrate theming into their projects.

    Installation

    npm install sansiv-themes

    Usage

    Basic Setup

    Wrap your application with the SansivThemes component:

    import React from "react";
    import SansivThemes from "sansiv-themes";
    
    const App = () => {
      return (
        <SansivThemes>
          <YourApp />
        </SansivThemes>
      );
    };
    
    export default App;

    Access Theme Values

    Use the useSansivTheme hook to access theme values:

    import React from "react";
    import { useSansivTheme } from "sansiv-themes";
    
    const ExampleComponent = () => {
      const { themeValues, toggleTheme } = useSansivTheme();
    
      return (
        <div
          style={{
            backgroundColor: themeValues.sansivBG,
            color: themeValues.sansivTitle,
          }}
        >
          <h1>Dynamic Theming Example</h1>
          <button onClick={toggleTheme}>Toggle Theme</button>
        </div>
      );
    };
    
    export default ExampleComponent;

    Features

    • Dark mode toggle
    • 5 default themes
    • Custom themes with configurable colors

    License

    MIT