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

tailwindcss-plugin-icons

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss-plugin-icons

Tailwind CSS icons with classes

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
142
decreased by-21.11%
Maintainers
1
Weekly downloads
 
Created
Source

tailwindcss-plugin-icons

npm LICENSE

Tailwind CSS port of @unocss/preset-icons.

# Npm
npm install tailwindcss-plugin-icons
# Pnpm
pnpm add tailwindcss-plugin-icons
# Yarn
yarn add tailwindcss-plugin-icons

How to use

  1. Search the available icon sets at Icônes or Iconify and choose the icons your project needs
  2. Install the icon sets with npm install @iconify-json/[the-collection-you-want]. For example heroicons npm install @iconify-json/heroicons-outline @iconify-json/heroicons-solid
  3. Configure the plugin in your tailwind.config.js:
const { Icons } = require('tailwindcss-plugin-icons')

module.exports = {
  [...]
  plugins: [
    Icons({
      heroiconsSolid: {
        // By default will search in common iconify module locations
        icons: ['trash', 'trash?bg']
      },
      heroiconsOutline: {
        icons: ['lock-open', 'lock-closed'],
        // Can be some other module too
        location: 'my-icon-alias/icons.json'
      },
      custom: {
        icons: ['loading'],
        // Can be a URI
        location:
          'https://gist.githubusercontent.com/JensDll/4e59cf6005f585581975941a94bc1d88/raw/6cdeb3cb9dacd47fd132d49004a2e8f4cbc0774f/icons.json'
      },
      customAlt: {
        icons: ['loading'],
        // Can be a relative or absolute path
        location: './src/icons.json'
      }
    })
  ]
}
  1. Write icons with Tailwind CSS classes directly in your markup:
<div class="i-heroicons-solid-trash h-5 w-5"></div>

Example

Keywords

FAQs

Package last updated on 05 May 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