A utility library to lookup TailwindCSS Heroicons by their name

Related tags

CSS heroicons-lookup
Overview

Welcome to heroicons-lookup 🔍

Version Documentation Maintenance License: MIT Twitter: naquiroz_

A utility library to lookup TailwindCSS Heroicons by their name. Based on @jsmith's gist

🏠 Homepage

Demo(coming soon)

Use cases

Say for example, you store in database, entities that have an icon. The intuitive thing to do is to store the name of the icon in the database. Another example could be a situacion where you want to change the icon based on the user input, or based on certain conditions.

If you need to import an icon dynamically based on it's name, you can with this library. By using the function below, you can obtain exactly the icon you want, as react component.

Install

npm install heroicons-lookup

Usage

{ const Icon = lookupIcon(iconName, "solid") return ( ) }">
import {lookupIcon} from "heroicons-lookup";

const ExampleComponent = ({iconName="ArrowLeftIcon"}: {iconName: string}) => {
  const Icon = lookupIcon(iconName, "solid")
  return (
    <Icon className="flex h-5 w-5"/>
  )
}

Documentation

lookupIcon(iconName: string, format: "outline"|"solid")

Finds an icon element with the name indicated (if any). Throws an error if not found.

Author

👤 Nicolas Quiroz [email protected]

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2022 Nicolas Quiroz [email protected].
This project is MIT licensed.

This README was generated with ❤️ by readme-md-generator

You might also like...

A library to make creating CSS polyfills much easier.

UPDATE (2016-12-22): I am no longer supporting this library for all the reasons I address in my post The Dark Side of Polyfilling CSS. If you choose t

Oct 9, 2022

Text-based user interface CSS library

Text-based user interface CSS library

TuiCss Text-based user interface CSS library -- Documentation -- About TuiCss is a library focused to create web applications using an interface based

Jan 2, 2023

Morfy - Fast morphing library for the web

morfy Fast morphing library for the web · Homepage · View Demo · Report Bug / Request Feature · Table of Contents About Installation Usage Test Contac

Aug 28, 2021

RxHtmlButtonLibrary - Html Button Styling Library by roxunlimited.com using CSS and jQuery.

RxHtmlButtonLibrary - Html Button Styling Library by roxunlimited.com using CSS and jQuery.

rxHTMLButton Library v0.3 rxHTMLButton Library will work on almost every HTML tag. It will smoothly work on 'a href link', 'button type button', 'inpu

Sep 16, 2022

Cooltipz.css - A highly customisable, minimal, pure CSS tooltip library

Cooltipz.css - A highly customisable, minimal, pure CSS tooltip library

Cooltipz.css - Cool tooltips Cool customisable tooltips made from pure CSS Lightweight • Accessible • Customisable • Simple Cooltipz.css is a pure CSS

Dec 24, 2022

A pure html and css library for dark mode in your website.

Dark Mode A pure html and css library for dark mode in your website. Features It has a smooth setting and also it changes via system settings aswell.

Jan 6, 2022

A CSS button library built using Sass and Compass

Buttons 2.0 Buttons 2.0 Buttons is a highly customizable production ready mobile web and desktop css button library. Buttons is a free open source pro

Jan 4, 2023

micro-library for CSS Flexbox and CSS Grid

SpeedGrid micro-library for CSS Flexbox and CSS Grid Overview SpeedGrid dynamically generates inline CSS by specifying the class name. Easy maintenanc

Mar 26, 2022

A modern, responsive CSS boilerplate library to kickstart any web-based project.

A modern, responsive CSS boilerplate library to kickstart any web-based project.

Peacock CSS Peacock is a modern, responsive CSS boilerplate library to kickstart any web-based project. It is simple, lightweight and it contains all

Jan 23, 2022
Owner
Nicolás Quiroz
Software Engineer @ The Not Company
Nicolás Quiroz
Low-level CSS Toolkit – the original Functional/Utility/Atomic CSS library

Basscss Low-level CSS toolkit – the original Functional CSS library https://basscss.com Lightning-Fast Modular CSS with No Side Effects Basscss is a l

Basscss 5.8k Dec 31, 2022
A utility-first CSS framework for rapid UI development.

A utility-first CSS framework for rapidly building custom user interfaces. Documentation For full documentation, visit tailwindcss.com. Community For

Tailwind Labs 63.5k Dec 30, 2022
A utility-first CSS framework for rapid UI development.

A utility-first CSS framework for rapidly building custom user interfaces. Documentation For full documentation, visit tailwindcss.com. Community For

Tailwind Labs 63.5k Jan 1, 2023
selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explorer 6-8.

Selectivizr CSS3 selectors for IE 6-8 selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explor

Keith Clark 1.7k Dec 18, 2022
Small utility for react-redux's `useSelector` that allows passing args.

use-selector-with Monorepo for the following two packages: use-selector-with: Small utility for react-redux's useSelector that allows passing args. es

Codecademy 5 Jan 28, 2022
Chrome extension that creates a button on Lever job application pages which shows you how their api parses your resume.

EDIT I have helped make a website that provides the same functionality. Repo: https://github.com/KnlnKS/resume-parser Site: https://resume-parser.verc

Kunalan Kevin Subagaran 17 May 19, 2022
This project is for those who are new to open-source and looking for make their first contribution

First Contribution This project is for those who are new to open-source and looking for make their first contribution. Follow the steps below :- If yo

Heritage Institute of Technology 2025 122 Jan 4, 2023
:handbag: A beautiful CSS library to kickstart your projects

Picnic CSS Unpack your meal and get coding. An invasive CSS library to get your style started. Getting started There are many ways of using Picnic CSS

Francisco Presencia 3.6k Jan 4, 2023
Simple CSS library for semantic HTML markup

awsm.css awsm.css is a simple CSS library for semantic HTML, which doesn't require classes, ids, attributes, etc. Just start to create page with HTML5

Igor Adamenko 1.4k Dec 30, 2022
A built-time CSS library for styling React components.

Stylin Stylin is a build-time CSS library that offers an elegant way to style React components. It extends CSS Modules and adds some missing features

Sultan 173 Dec 30, 2022