npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zaide6137/m3-web-components

v0.1.7

Published

Material 3 React Web Components

Readme

Material 3 Components - Web

A modern React component library based on the Material 3 (M3) Design System. This library provides a powerful, dynamic theming engine that generates full color palettes from a single seed color and supports seamless light, dark, and auto mode switching.

Installation

npm install @zaide6137/m3-components-web

Get Started

This Library is designed to be easy to use. The setup involves only 1 step to make everything work.

The first and only step required to setup the library is to wrap your root component with the ThemeProvider component.

import { ThemeProvider } from '@zaide6137/m3-components-web';

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        <ThemeProvider 
            seedColor="#6750A4" 
            defaultColorScheme="auto"
        >
          {children}
        </ThemeProvider>
      </body>
    </html>
  );
}

For NextJS Users, wrap your layout.tsx with the ThemeProvider.

To customize the initial color of the entire components, modify the seedColor props of the ThemeProvider with the HEX Color Code you want. The seed color will be the basis of all the color pallete ThemeProvider will generate. It will automatically generate the appropriate Color Pallete based on the Material 3 Tokens. Check this out to learn more about how Material 3 Color Roles & Tokens work.

To set the initial color scheme of the entire components, modify the defaultColorScheme prop of ThemeProvider. You can set it to Light, Dark and Automatic

How It Works

The library works by auto generating the Material 3 Color Tokens based on the provided seed color. Then your app will utilize the themeColors object from the useGlobalTheme() hook to style your UI based on the Material 3 Design.

Built in components like Button, Calendar, BigCalendar, EditText from this library is already using the styles of themeColors automatically.

Usage

Accessing Theme Colors

Use the useGlobalTheme hook to access generated tokens. These colors reactively update when the theme or mode changes.

To style your custom UI like the background for your page, you can use the inline style method on the root div to set the background color of your page.

Example:

"use client"
import { useGlobalTheme } from '@zaide6137/m3-components-web';

export default function MyHomePage(){
    const { themeColors } = useGlobalTheme();
    return (
        <div 
            style={{
                backgroundColor: themeColors.background
            }}
        >
            <h1 style={{
                color: themeColors.onSurface
                }}
            >
                Hello World!
            </h1>
        </div>
    )
}

Change the Theme Colors

To change the entire brand color of your application, use the setThemeColors function. This takes a single hex color (the "seed") and automatically regenerates all Material 3 color tokens for your app instantly.

"use client"
import { useGlobalTheme } from '@zaide6137/m3-components-web';

export default function BrandSwitcher() {
    const { setThemeColors } = useGlobalTheme();

    return (
        <div>
            {/* Updates the entire app palette to Teal tones */}
            <button onClick={() => setThemeColors("#006A6A")}>
                Set Brand to Teal
            </button>

            {/* Updates the entire app palette to Purple tones */}
            <button onClick={() => setThemeColors("#6750A4")}>
                Set Brand to Purple
            </button>
        </div>
    );
}

Theme Mode Switching

To switch between visual modes (Light, Dark, or System), use the setColorScheme function. This maintains your current brand color while shifting the background and surface tones to match the selected mode.

"use client"
import { useGlobalTheme } from '@zaide6137/m3-components-web';

export default function AppearanceSwitcher() {
    const { setColorScheme } = useGlobalTheme();

    return (
        <div>
            {/* Forces Light Mode */}
            <button onClick={() => setColorScheme("light")}>
                Light Mode
            </button>

            {/* Forces Dark Mode */}
            <button onClick={() => setColorScheme("dark")}>
                Dark Mode
            </button>

            {/* Automatically syncs with the user's OS settings */}
            <button onClick={() => setColorScheme("auto")}>
                System Preference
            </button>
        </div>
    );
}

License

MIT © Zaide LLC 2026