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

@swift-man/material-design-color

v2.1.0

Published

Material Design 3 color schemes (light/dark, 48 roles) and Material 2 palette for TypeScript / JavaScript. Framework-agnostic — works in React Native, Expo, web, Node.

Downloads

57

Readme

MaterialDesignColor for JavaScript / TypeScript

Material Design 3 preset color schemes (light/dark, 48 roles) and the classic Material 2 palette as plain TypeScript constants.

This package is framework-agnostic — pure TS with no runtime dependencies. Works in:

  • React Native / Expo (Metro consumes the published dist/ ESM output)
  • Plain React, Vue, Svelte, vanilla web
  • Node.js (ESM, 16+), Deno, Bun

The package is published as ESM-only ("type": "module"). CommonJS consumers can use a dynamic await import("@swift-man/material-design-color") or migrate to ESM. No native modules, no Expo config plugins, no prebuild required.

Install

npm install @swift-man/material-design-color
# or
yarn add @swift-man/material-design-color
# or
pnpm add @swift-man/material-design-color

Usage

Material 3 preset color schemes

import { createMaterialTheme, getMaterialThemeKeyColors } from "@swift-man/material-design-color";

const theme = createMaterialTheme({ preset: "expressive", dark: false });
const primary = theme.colorScheme.primary;          // "#006B5A"
const onPrimaryContainer = theme.colorScheme.onPrimaryContainer;
const keyPrimary = getMaterialThemeKeyColors("expressive").primary;

Available presets: tonalSpot, fidelity, content, monochrome, neutral, vibrant, expressive, rainbow, fruitSalad.

Material Theme Builder color schemes

Paste role colors from Material Theme Builder into colorScheme. Missing roles fall back to the selected preset.

import { createMaterialTheme } from "@swift-man/material-design-color";

const theme = createMaterialTheme({
  preset: "tonalSpot",
  colorScheme: {
    primary: "#6750A4",
    onPrimary: "#FFFFFF",
    primaryContainer: "#EADDFF",
    onPrimaryContainer: "#21005D",
    surface: "#FFFBFE",
    onSurface: "#1C1B1F",
  },
});

Material 2 palette

import { colors } from "@swift-man/material-design-color";

const backgroundColor = colors.pink400;             // "#EC407A"
const accent = colors.tealA700;                     // "#00BFA5"

React Native / Expo

import { createMaterialTheme, colors } from "@swift-man/material-design-color";
import { View, Text } from "react-native";

const theme = createMaterialTheme({ preset: "fruitSalad", dark: true });

export function Example() {
  return (
    <View style={{ backgroundColor: theme.colorScheme.surface }}>
      <Text style={{ color: theme.colorScheme.onSurface }}>Hello</Text>
      <View style={{ backgroundColor: colors.tealA700 }} />
    </View>
  );
}

Plain web

import { getMaterialTheme } from "@swift-man/material-design-color";

document.body.style.backgroundColor = getMaterialTheme("neutral").colorScheme.surface;

Node / Deno / Bun

import { colors, lightColorScheme } from "@swift-man/material-design-color";

console.log(colors.blue500);              // "#2196F3"
console.log(lightColorScheme.primary);    // "#65558F"

Cross-language consistency

The hex values here are generated from the same JSON tokens as the iOS Swift package and the Python package, so a colors.pink400 in your RN app is byte-identical to MaterialPalette.pink400 on iOS and colors.pink400 in Python. Useful when you ship the same product across stacks.