Socket
Socket
Sign inDemoInstall

@unocss/preset-icons

Package Overview
Dependencies
Maintainers
1
Versions
367
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unocss/preset-icons

Pure CSS Icons for UnoCSS


Version published
Weekly downloads
146K
decreased by-18%
Maintainers
1
Weekly downloads
 
Created

What is @unocss/preset-icons?

@unocss/preset-icons is a preset for UnoCSS that provides a convenient way to use icons from various icon sets in your projects. It allows you to easily integrate and customize icons using utility-first CSS.

What are @unocss/preset-icons's main functionalities?

Basic Icon Usage

This feature allows you to use icons from various icon sets by simply adding a class to your HTML or JSX. The class name follows a specific pattern that includes the icon set and the icon name.

import { defineConfig } from 'unocss';
import presetIcons from '@unocss/preset-icons';

export default defineConfig({
  presets: [
    presetIcons(),
  ],
});

// In your HTML or JSX
<div class="i-heroicons-outline-home"></div>

Customizing Icon Size

You can easily customize the size of the icons by using utility classes like `text-2xl`. This leverages the utility-first approach of UnoCSS to provide flexible and easy-to-use customization options.

<div class="i-heroicons-outline-home text-2xl"></div>

Customizing Icon Color

Similar to size customization, you can also change the color of the icons using utility classes like `text-red-500`. This makes it easy to integrate icons that match your design system.

<div class="i-heroicons-outline-home text-red-500"></div>

Other packages similar to @unocss/preset-icons

Keywords

FAQs

Package last updated on 03 Dec 2023

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