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

md3-next

v0.1.3

Published

Material Design 3 theme and components for Next.js with MUI

Readme

md3-next

Material Design 3 theme and components for Next.js — powered by MUI.

Generate a full MD3 colour scheme from a single seed colour, get automatic light/dark mode, and have every MUI component styled to match the Material Design 3 spec.

Documentation · Components · Theming · API Reference

Looking for a head start? Check out our premium templates — production-ready Next.js apps built with md3-next.

Installation

npm install md3-next @mui/material @emotion/react @emotion/styled

Quick Start

// app/theme.ts
import { createMD3Theme } from "md3-next";

const theme = createMD3Theme({
  seed: "#6750A4",
  mode: "system",
});

export default theme;
// app/providers.tsx
"use client";

import { MD3Provider } from "md3-next";
import theme from "./theme";

export function Providers({ children }: { children: React.ReactNode }) {
  return <MD3Provider theme={theme}>{children}</MD3Provider>;
}
// app/layout.tsx
import { Providers } from "./providers";

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>
        <Providers>{children}</Providers>
      </body>
    </html>
  );
}

What You Get

From a single seed colour, createMD3Theme generates the full MD3 token set:

| Token | Description | | ----------------------------------------------- | ------------------------------------------ | | primary / onPrimary | Primary brand colour and its contrast text | | primaryContainer / onPrimaryContainer | Lighter primary for containers | | secondary / onSecondary | Secondary colour pair | | secondaryContainer / onSecondaryContainer | Secondary container pair | | tertiary / onTertiary | Tertiary accent pair | | surface / onSurface | Default surface and text | | surfaceContainer / surfaceContainerHigh / … | MD3 surface hierarchy | | outline / outlineVariant | Border and divider colours | | error / onError / errorContainer | Error states | | inverseSurface / inverseOnSurface | Snackbar / tooltip surfaces |

All tokens are available for both light and dark schemes.

Using Tokens

Access the current colour tokens and mode controls in any client component:

"use client";

import { useMD3 } from "md3-next";

export function MyComponent() {
  const { mode, toggleMode, tokens } = useMD3();

  return (
    <div style={{ backgroundColor: tokens.surfaceContainer }}>
      <p style={{ color: tokens.onSurface }}>Current mode: {mode}</p>
      <button onClick={toggleMode}>Toggle</button>
    </div>
  );
}

MD3 Button Variants

The theme adds two MD3-specific button variants on top of MUI's defaults:

<Button variant="contained">Filled</Button>
<Button variant="tonal">Filled Tonal</Button>
<Button variant="elevated">Elevated</Button>
<Button variant="outlined">Outlined</Button>
<Button variant="text">Text</Button>

Styled Components

Every MUI component is automatically themed to match the MD3 spec:

  • Buttons — pill-shaped, no uppercase, proper state layers
  • Cards — elevated / filled / outlined variants
  • FAB — rounded square, MD3 shadow, primaryContainer colour
  • Chips — 8 px radius, outline & filled styles
  • Switch — wide-track MD3 toggle
  • Text Fields — outlined and filled with MD3 indicator colours
  • Dialogs — extra-large radius, surfaceContainerHigh background
  • Navigation — bottom nav, tabs, drawer styled to spec
  • App Bar — surface colour, no elevation
  • Typography, badges, progress indicators, tooltips, snackbars, alerts…

API Reference

createMD3Theme(options)

| Option | Type | Default | Description | | ------ | ------------------------------- | ---------- | ----------------------------- | | seed | string | — | Hex colour (e.g. "#6750A4") | | mode | "light" \| "dark" \| "system" | "system" | Colour scheme preference |

Returns an MD3Theme object containing .light and .dark MUI themes, the raw .tokens, and the .seed.

<MD3Provider theme={md3Theme}>

Wraps your app with the correct MUI ThemeProvider and CssBaseline. Handles system preference detection and mode switching.

useMD3()

Returns { mode, preference, setMode, toggleMode, tokens, seed }.

License

MIT


Website · Documentation · Templates · Showcase