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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@slimr/mdi-paths

v2.1.43

Published

[Material Design Icon](https://materialdesignicons.com) paths for any TS/JS project, packaged as single files default export = path.

Downloads

13

Readme

🪶 @slimr/mdi-paths npm package

Material Design Icon paths for any TS/JS project, packaged as single files default export = path.

Compared to Iconify

  • Has all of the mdi aliases
  • Uses Lazy ESM Imports instead of fetching from CDN/internet
  • Is smaller bundle impact - icon files are smaller, React component smaller

Features

  • Lazy ESM Imports instead of fetching from CDN/internet
  • Each icon is a seperate Javascript module, named to match the name in https://materialdesignicons.com, so easy to find
  • For React fans, you can use LazyIconSvg or IconSvg from @slimr/mdi-paths/react.

Context

@slimr is a set of slim React (hence '@slimr') libs. Check them all out on github!

Installation

npm install @slimr/mdi-paths

Usage

Just search for an icon on materialdesignicons.com and look for its name.

The name translates to PascalCase in @slimr/mdi-paths.

Also it's possible to import with an alias. You can find them on the detail page of the respective icon.

For React, I recommend you use the bundled react components, LazyIconSvg and IconSvg.

Example with LazyIconSvg:

// icon.tsx
import {LazyIconSvg, LazyIconSvgProps} from '@slimr/mdi-paths/react'

const icons = {
  home: () => import('@slimr/mdi-paths/Home'),
}

type IconKeys = keyof typeof icons
type IconProps = Omit<LazyIconSvgProps, 'name' | 'svgPathImport'> & {name: IconKeys}

export function Icon({name, ...props}: IconProps) {
  return <LazyIconSvg pathImporter={icons[name]} {...props} />
}

Dependencies, References & Inspirations

  • mdi-react - The generator in this package was adapted from that one (Thanks!). This package achieves similar things but does so with much less bandwidth penalty per icon.
  • materialdesignicons.com - Where to browse icons
  • @mdi/js - Very similar to this lib, but puts all the paths in one file
  • @mdi/svg - Where this lib gets the icons from