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

react-material-design-provider

v1.2.0

Published

Unofficial implementation of Material Design 3 theme provider for React

Readme

react-material-design-provider

Unofficial implementation of Material Design 3 theme provider for React.

This library does not implement components. The ideia is to implement the design system of Material Design (typography, colors, palette, etc.) and provide them to the application.

Installation

npm install react-material-design-provider
# or
yarn add react-material-design-provider

Usage

To use Material Design, wrap you app under MaterialProvider and pass your theme:

import { MaterialLightTheme, MaterialProvider } from "react-material-design-provider"


export function App() {
    return (
        <MaterialProvider theme={MaterialLightTheme}>
            {/* ... */}
        </MaterialProvider>
    )
}

Then, to get the theme, call useMaterialTheme in your component:

import { useMaterialTheme } from "react-material-design-provider"


export function Component() {
    
    
    const { colors } = useMaterialTheme()


    // ...
}

The library provides the default light and dark themes of Material Design. If you wish a custom theme, create an object of type MaterialTheme and pass it to the provider's theme prop:

import { MaterialTheme } from "react-material-design-provider"


const customTheme: MaterialTheme = {
    palette: {
        // ...
    },
    shape: {
        // ...
    },
    state: {
        // ...
    },
    typography: {
        // ...
    },
    colors: {
        // ...
    },
}

Docs for material provider

MaterialProvider

The provider of Material Design. It receives the theme through theme prop. The theme is an object of type MaterialTheme.

useMaterialTheme

function useMaterialTheme(): MaterialTheme

Hook to get current material theme. Returns an object of type MaterialTheme.

MaterialTheme

type MaterialTheme = {
    palette: Palette
    shape: Shape
    state: State
    typography: Typography
    colors: Colors
}

Type that represents a material theme. It contains the properties used in Material Design. See:

MaterialLightTheme

Default light theme of Material Design 3. Object of type MaterialTheme.

MaterialDarkTheme

Default dark theme of Material Design 3. Object of type MaterialTheme.

Docs for Material Design implementation

Palette

The palette contains a few key colors and its tone variations. Those colors are referenced on other places. See: palette.ts.

The default palette key colors are:

| Color name | Color code | |---------------|------------| primary | #6750A4 secondary | #958DA5 tertiary | #B58392 error | #E46962 neutral | #938F96 neutral variant | #938F99

Shape

Shape represents how much the surface border is rounded. See: shape.ts.

State

State represents the layer opacity above the surface when the surface is hovered, pressed, focused or dragged. If the surface is disabled, the state represents the surface'a opacity. See: state.ts.

Typography

The typography specifies the text properties for each variant and size. See: typography.ts.

Colors

The colors tokens used in Material Design. Some tokens are added to calculate the opacity or to improve usability (like the elevation tokens). See: colors-light.ts, colors-dark.ts and colors-type.ts.