Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuxt-icons

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-icons

[![nuxt-icons](https://i.imgur.com/SR1XufB.png "nuxt-icons banner")](https://github.com/gitFoxCode/nuxt-icons) # Nuxt Icons A module for nuxt3 that allows you to use your own SVG icons quickly and enjoyably.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12K
decreased by-7.76%
Maintainers
1
Weekly downloads
 
Created
Source

nuxt-icons

Nuxt Icons

A module for nuxt3 that allows you to use your own SVG icons quickly and enjoyably.

playground-usage

Usage

  1. Create a icons folder in assets: assets/icons
  2. Drop your icons with the .svg extension into the icons folder
  3. In the project, use <nuxt-icon name="">, where name is the name of your svg icon from the folder

If you need to use the original color from the svg file (for example, if your icon has defs) you need to use the fill attribute:
<nuxt-icon name="mySuperIcon" fill />

What this module does

The module retrieves all svg files from the assets/icons folder, removes the height and width from them to make them scalable, and using the <nuxt-icon> component allows them to be used. <nuxt-icon> injects the SVG code directly into <span>.

Development

  • Run npm run dev:prepare to generate type stubs.
  • Use npm run dev to start playground in development mode.

Thoughts and ToDo's:

  • Ability to load icons only by component/page in order not to waste unnecessary space if the icon is not used at the time
  • Automatic svg file optimization
  • Automatic icon scalingthat have non-square dimensions to maintain their proportions (maybe with preserveAspectRatio)
  • Usable for previous nuxt versions
  • Loading icons into symbol svg sprite (rather worsens performance)

Keywords

FAQs

Package last updated on 07 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc