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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@noughts/svelte-material-symbols

v1.3.3

Published

A Svelte library for displaying Google Material Symbols as SVG icons.

Readme

svelte-material-symbols

A Svelte library for displaying Google Material Symbols as SVG icons.

Features

  • Lightweight: No font files required, dynamically loads only the SVGs you need
  • Dark Mode Support: Automatically detects system settings and switches colors
  • Layout Stable: Prevents layout shifts during icon loading
  • Highly Customizable: Supports all Material Symbols options

Installation

npm install @noughts/svelte-material-symbols

Basic Usage

<script>
  import { MaterialSymbol } from '@noughts/svelte-material-symbols';
</script>

<!-- Basic usage -->
<MaterialSymbol icon="home" />

<!-- Customized icon -->
<MaterialSymbol icon="star" fill color="gold" size={32} />

Properties

| Property | Type | Default | Description | |----------|------|---------|-------------| | icon | string | Required | Icon name to display | | fill | boolean | false | Whether to fill the icon | | weight | number | 400 | Font weight (200-700) | | grade | -25 \| 0 \| 200 | 0 | Grade adjustment | | opticalSize | 20 \| 24 \| 40 \| 48 | 24 | Optical size | | color | string | "#000000" | Color in light mode | | darkColor | string | value of color | Color in dark mode | | opacity | number | 1 | Opacity (0-1) | | size | number \| undefined | undefined | Size in pixels (defaults to 1em if unspecified) |

Usage Examples

Basic Icons

<MaterialSymbol icon="check_circle" />
<MaterialSymbol icon="favorite" fill />
<MaterialSymbol icon="settings" weight={700} />

Color and Size Customization

<MaterialSymbol icon="star" color="orange" size={48} />
<MaterialSymbol icon="error" color="red" size={24} />

Dark Mode Support

<!-- Black in light mode, white in dark mode -->
<MaterialSymbol icon="brightness_6" color="#333333" darkColor="#eeeeee" />

Using in Buttons

<button>
  <MaterialSymbol icon="add" />
  Add Item
</button>

Star Rating Implementation

<div class="rating">
  <MaterialSymbol icon="star" fill color="gold" />
  <MaterialSymbol icon="star" fill color="gold" />
  <MaterialSymbol icon="star" fill color="gold" />
  <MaterialSymbol icon="star" color="gold" />
  <MaterialSymbol icon="star" color="gold" />
</div>

Available Icons

All icons provided by Google Material Symbols are available. You can find icon names on the Material Symbols official site.

Examples: home, star, favorite, settings, menu, search, add, delete, edit, check, close, etc.

Technical Details

SVG Loading Method

This library loads SVG files directly from the official Google Material Design Icons GitHub repository. It uses CSS mask to colorize SVGs with background colors, enabling lightweight and flexible color changes.

Dark Mode Detection

Uses the prefers-color-scheme: dark media query to automatically detect system dark mode settings and apply appropriate colors.

Development

Start Development Server

npm run dev

Build Library

npm run package

Build for Production

npm run build

License

This project is released under the MIT License.