Code Monkey home page Code Monkey logo

material-design-icons-svg's Introduction

material-design-icons-svg

This module contains all icons from https://materialdesignicons.com and gives you some methods to load them in your browser (assumed you're using browserify/webpack/another commonjs module loader).

Installation

npm install material-design-icons-svg

Usage

// Load all 1600 material design icons, ~170kb gzipped
var paths = require('material-design-icons-svg/paths')
var icons = require('material-design-icons-svg')(paths)

// Then you can use it wherever you like
var svg = icons.getSVG('access-point')
// returns inline svg
// <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.93,4....0Z" /></svg>

$(document.body).append(svg)


// OR if you care about render performance

// You can load icons using the `<use>` notation.
icons.initialize(document.body) // Appends all icons to document.body
var icon = icons.getIcon('access-point')
// returns reference to initialized svg
// <svg>
//   <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#deviantart">
//   </use>
// </svg>
$(document.body).append(icon)


// You can also load specific icons if you don't like to load a ton of unused icons into your app
var icons = require('material-design-icons-svg')({
  'account': require('material-design-icons-svg/paths/account'),
  'menu': require('material-design-icons-svg/paths/menu')
})

var svg = icons.getSVG('menu')
// Returns inline svg of `menu` icon

Example

Check out ./example.js

node example.js

material-design-icons-svg's People

Contributors

dependabot[bot] avatar marcbachmann avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

material-design-icons-svg's Issues

Just a thank you! ๐ŸŽ‰

Just wanted to drop by and say thank you! The icons haven't been updated since ages and this repository provides all the icons in a very consumable way. I'm about to integrate it into mkdocs-material to finally replace the icon font with inline SVG ๐Ÿ˜ŠKeep it up!

This is not an issue, just a thank you note, which is why I'm closing it straight away ๐Ÿ˜‰

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

npm
docs/package.json
  • esbuild ^0.21.0
  • lodash ^4.17.21
  • simple-text-search ^1.1.5
package.json
  • @mdi/svg ^7.2.96

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.