Skip to content

About

🎭 React library for conveniently displaying SVG icons using CSS masks

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎭 react-icon-mask-lib

A lightweight and extensible React library for displaying SVG icons via CSS masks. Allows you to use monochrome icons with customizable color, size, and styles.

npm
license
bundle size

✨ Features

  • πŸ”Ή Support for SVG via CSS mask-image
  • 🎨 Change color via background-color
  • πŸ“¦ Lightweight and easy integration
  • βš™οΈ Flexibility β€” you can use children for arbitrary content
  • πŸ“± Support for custom classes, sizes, and styles

πŸš€ Installation

npm install react-icon-mask-lib

πŸ’» Usage example

import React from 'react'
import { Icon } from 'react-icon-mask-lib'

// Your svg file when loaded through children
import { ReactComponent as CheckIcon } from './icons/check.svg'

const App = () => {
	return (
		<div>
			// Icon with a name from public/icons
			<Icon name='arrow-right' size={32} color='#2593F2' />
			// Icon via children
			<Icon size={32} color='#4caf50'>
				<CheckIcon />
			</Icon>
			// Icon with a custom class
			<Icon
				name='user'
				size={40}
				color='white'
				className='bg-gray-800 rounded-full shadow-lg'
			/>
		</div>
	)
}

export default App

About

🎭 React library for conveniently displaying SVG icons using CSS masks

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages