Coder Social home page Coder Social logo

heroicons's Introduction

Heroicons

Beautiful hand-crafted SVG icons, by the makers of Tailwind CSS.
Available as basic SVG icons and via first-party React and Vue libraries.

Browse at Heroicons.com →

Latest Release License

Basic Usage

The quickest way to use these icons is to simply copy the source for the icon you need from heroicons.com and inline it directly into your HTML:

<svg
  class="size-6 text-gray-500"
  fill="none"
  viewBox="0 0 24 24"
  stroke="currentColor"
  stroke-width="2"
>
  <path
    stroke-linecap="round"
    stroke-linejoin="round"
    d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
  />
</svg>

Both icon styles are preconfigured to be stylable by setting the color CSS property, either manually or using utility classes like text-gray-500 in a framework like Tailwind CSS.

React

First, install @heroicons/react from npm:

npm install @heroicons/react

Now each icon can be imported individually as a React component:

import { BeakerIcon } from '@heroicons/react/24/solid'

function MyComponent() {
  return (
    <div>
      <BeakerIcon className="size-6 text-blue-500" />
      <p>...</p>
    </div>
  )
}

The 24x24 outline icons can be imported from @heroicons/react/24/outline, the 24x24 solid icons can be imported from @heroicons/react/24/solid, the 20x20 solid icons can be imported from @heroicons/react/20/solid, and 16x16 solid icons can be imported from @heroicons/react/16/solid.

Icons use an upper camel case naming convention and are always suffixed with the word Icon.

Browse the full list of icon names on UNPKG →

Vue

First, install @heroicons/vue from npm:

npm install @heroicons/vue

Now each icon can be imported individually as a Vue component:

<template>
  <div>
    <BeakerIcon class="size-6 text-blue-500" />
    <p>...</p>
  </div>
</template>

<script setup>
import { BeakerIcon } from '@heroicons/vue/24/solid'
</script>

The 24x24 outline icons can be imported from @heroicons/vue/24/outline, the 24x24 solid icons can be imported from @heroicons/vue/24/solid, the 20x20 solid icons can be imported from @heroicons/vue/20/solid, and the 16x16 solid icons can be imported from @heroicons/vue/16/solid.

Icons use an upper camel case naming convention and are always suffixed with the word Icon.

Browse the full list of icon names on UNPKG →

Contributing

While we absolutely appreciate anyone's willingness to try and improve the project, we're currently only interested in contributions that fix bugs, for example things like incorrect TypeScript types, or fixing an icon that's been exported with a fill instead of a stroke, etc.

We're not accepting contributions for new icons or adding support for other frameworks like Svelte or SolidJS. Instead we encourage you to release your own icons in your own library, and create your own packages for any other frameworks you'd like to see supported.

License

This library is MIT licensed.

heroicons's People

Contributors

9renpoto avatar adamwathan avatar alexandernanberg avatar apuntovanini avatar aryaveersr avatar belgattitude avatar bradlc avatar cyberalien avatar davydevries avatar dependabot[bot] avatar furkanmavili avatar hubm avatar itsmapleleaf avatar manaust avatar neupauer avatar nspehler avatar podpage avatar reinink avatar robinmalfait avatar sachinraja avatar saibotk avatar simonswiss avatar sschoger avatar stefanprobst avatar thecrypticace avatar tibianmod avatar vkaelin avatar vottuscode avatar zmwangx avatar znicholasbrown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

heroicons's Issues

Outline-md globe icon bug with background

The outline-md globe icon looks like this with a background:

image

Example code:

<div class="flex flex-row items-center">
  <div class="p-2 mr-2 -ml-8 bg-blue-500 rounded-full">
    <svg class="w-6 h-6 text-white" fill="currentColor" viewBox="0 0 24 24"><path d="M3.05493 11H5C6.10457 11 7 11.8954 7 13V14C7 15.1046 7.89543 16 9 16C10.1046 16 11 16.8954 11 18V20.9451M8 3.93552V5.5C8 6.88071 9.11929 8 10.5 8H11C12.1046 8 13 8.89543 13 10C13 11.1046 13.8954 12 15 12C16.1046 12 17 11.1046 17 10C17 8.89543 17.8954 8 19 8L20.0645 8M15 20.4879V18C15 16.8954 15.8954 16 17 16H20.0645M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="#4A5568" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
    </svg>
  </div>
  <div class="text-xl font-bold rounded md:text-2xl">With an awesome community</div>
</div>

I think there should not be a half cutted ocean in the middle of the land.

Transfer npm package

I've been using tailwind for a while and can't wait for tailwind ui. My has always been less than 6kb since we started using tailwind.

I empty published in the two packages to reserve it for you guys and would like to transfer them to you.

npm i heroicons
npm i heroicon

FR: Move class to beginning of svg element

Firstly, thanks for making this, super useful!

Thoughts on moving the class attribute to the beginning of the SVG element? Whenever I use these icons, I usually end up modifying the class attribute or replacing it anyway. Guessing most folks do the same thing, so why not make it front and center?

If this is a feature request you think is a good idea, I'd be happy to submit a PR! 👍

Moon Icon

Already have the sun icon, now we need the moon

Connection status

Icons showing connection status would be helpful. Online, offline, things like that.

Truck icon

It would be awesome to have a (Delivery) Truck icon

Typescript typing

Hey guys!

We're a heavy user of TailwindUI, but unfortunately, we're unable to use the heroicons components for React because of the lack of Typescript support.

Could you consider shipping also the typescript declaration files?

Icon Suggestions

I really love the work that you've done so far! If you need any more suggestions, I'm currently working on a fairly large (soon to be open source) project that requires very data-centric icons.

Common editor things like:

  • cut, save, save as, discard, files, convert

Software (very few icon libraries have these):

  • objects, functions, variables, expressions, data types, engine/core/kernel, extensions

Databases:

  • flat, structured, spreadsheet, object, directory, query

New Star icon size / placement

Hi. in the latest batch of new icons the Star seems to be sat a bit higher / or be slightly smaller than the other icons, makes alignment in app quiet difficult.

image

cheveron -> chevron

I think you should rename all the cheveron icons to use chevron instead... cheveron is not a word and also sounds kind of confusing

Figma import

Hello! Can some one help me with figma import?
I've tried import in Figma Desktop for Mac and after it they look wrong :(
I have previously used other icon sets and everything was ok

image

Tag releases when new icons are added

For people maintaining Heroicons component libraries (e.g. @codex-zaydek, and me), it's great to be able to watch the repo for releases only, not issues and comments, so that we know when to rebuild and republish.

Doesn't need to be anything fancy—no need for precise semantic versioning, or binaries being included. A bulleted list of which icons have been added would be 👌

Missing namespace

It seems that the dist versions of the icons, are missing the namespace tag?

<svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
vs.
<svg xmlns="http://www.w3.org/2000/svg"  fill="none" viewBox="0 0 24 24" stroke="currentColor">

Icon Request: Closed eye

Currently there is an open eye icon. It would be nice to have a closed eye so this could be possible:

Two inputs with eye icon. The first is open and the second is closed

Star icon

Hi :)

It would be great to add a star icon :)

Thanks ;)

Small export problem with arrows-expand (solid)

I noticed when preparing the Heroicons site that arrows-expand (in solid — does not apply to outline) uses <svg viewBox="0 0 19 20" fill="currentColor"> instead of <svg viewBox="0 0 20 20" fill="currentColor">. This is the only icon I’ve found that has an inconsistent viewbox.

[Request] Tags for every icon

Hi all! I’m maintaining https://heroicons.dev.

I have an advanced implementation for search ready to go; all I need are alternate tags for every icon here: https://github.com/codex-src/heroicons.dev/blob/master/src/App/helpers/icons.js.

For example: ["adjustments", "slider", "configure"], for every icon. This way, when a user searches for any of those tags, the website will very quickly return an array of matching icons.

If anyone is interested, I’d love your help! PRs and issues are welcome.

RSS icon

Thank you for the wonderful icon set. Would love to see this one added if possible.

image

Minus Icon

I sound like I am moaning something rotten - but there doesn't look to be a minus sign, but a plus sign. Well worth adding.

Switching from font-awesome to heroicons for applications.

Icon Request: Servers

I would like to request icons that depict a single server, multiple servers, and a network :)

🥳 I built a viewer for Heroicons

👉 https://heroicons.dev
👉 https://github.com/codex-src/heroicons-viewer

I thought Heroicons needed a web-based viewer — I’m constantly using http://feathericons.com so I wanted to build something similar.

I just built what you see above, like in a matter of hours, so it’s not polished yet. If anyone wants to submit a PR request, please be my guest.

I’d like to add:

  • Custom domain (https://heroicons.dev)
  • Search
  • Click to copy to the clipboard
  • Responsive
  • Dark mode
  • Support for solid icons

All feedback and suggestions welcome. I’d like to make this as representative of TailwindCSS/RefactoringUI as possible. If @adamwathan and Steve Schoger want to directly contribute or alter the aesthetic in any way to make it more representative of their brand, that too.

Icon Request: Document File

Since we have document-report it would be nice to also have something like this to indicate a file with text content:

out

Additional folder icons

A few additional folder icons would be really nice.
Would also be in keeping with the file icons.

  • Add folder icon
  • Open folder icon

Adding an open folder gives active state in tree views.

download

Adding a create folder icon syncs with the create file icon
images

Icon Request: Play / Pause / Stop

Thank you for building a lovely icon set and giving it away for free! I found them via Tailwind UI and I'm currently refactoring a side project to use both Tailwind UI components and heroicons.

Few icons I've been unable to replace and thought I'd let you know were:

  • Play
  • Pause
  • Stop
  • Bold
  • Italic
  • Underline

Icon Request: Social Media

I've seen that in some TWUI examples they use some social media icons, can you include them? Also linkedin and Behance

image

How do we tell which are which?

I noticed all the icons are in the distributable area, but have No way to of knowing which are which, the previews dont work because the SVGs arent formatted/written correctly.

Im curious if maybe you have the time, you can add the icon names below the icons in the large list in readme.md

Otherwise makes it very hard to find icons

[Bug] Several icons were not exported correctly

@skylerspark noticed there’s an issue with several of the icon’s rendering black for the stroke. I checked out the source for these icons and found it looks like they’ve been incorrectly exported.

See this issue for a visual of the bug: zaydek/heroicons.dev#1

You can see the following files are affected:

Searching 280 files for "fill=\"#" (regex, case sensitive)

/Users/zaydek/github/heroicons-viewer/src/components/heroicons/heroicons-2abb814/outline-md/md-currency-dollar.svg:
    1  <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
    2:   <path fill="#4A5568" d="M13.843 9.655a1 1 0 101.511-1.31l-1.51 1.31zm-3.686 4.69a1 1 0 00-1.51 1.31l1.51-1.31zM13 7a1 1 0 10-2 0h2zm-2 10a1 1 0 102 0h-2zm9-5a8 8 0 01-8 8v2c5.523 0 10-4.477 10-10h-2zm-8 8a8 8 0 01-8-8H2c0 5.523 4.477 10 10 10v-2zm-8-8a8 8 0 018-8V2C6.477 2 2 6.477 2 12h2zm8-8a8 8 0 018 8h2c0-5.523-4.477-10-10-10v2zm0 7c-.659 0-1.21-.18-1.567-.418C10.07 10.34 10 10.114 10 10H8c0 .99.602 1.765 1.324 2.246.729.486 1.678.754 2.676.754v-2zm-2-1c0-.114.07-.34.433-.582C10.79 9.18 11.342 9 12 9V7c-.998 0-1.947.268-2.676.754C8.602 8.234 8 9.009 8 10h2zm2-1c.904 0 1.563.332 1.843.655l1.511-1.31C14.597 7.472 13.317 7 12 7v2zm0 4c.659 0 1.21.18 1.567.418.364.243.433.468.433.582h2c0-.99-.602-1.765-1.324-2.246C13.947 11.268 12.998 11 12 11v2zm-1-6v1h2V7h-2zm0 9v1h2v-1h-2zm1-1c-.904 0-1.563-.332-1.843-.655l-1.51 1.31C9.402 16.528 10.682 17 12 17v-2zm2-1c0 .114-.07.34-.433.582-.357.238-.908.418-1.567.418v2c.998 0 1.947-.268 2.676-.754C15.398 15.766 16 14.991 16 14h-2zm-3-6v8h2V8h-2z"/>
    3  </svg>
    4  

/Users/zaydek/github/heroicons-viewer/src/components/heroicons/heroicons-2abb814/outline-md/md-moon.svg:
    1  <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
    2:   <path fill="#4A5568" d="M20.354 15.354l.928.373a1 1 0 00-1.3-1.3l.372.927zM8.646 3.646l.928.373a1 1 0 00-1.301-1.301l.373.928zm11.335 10.78c-.92.37-1.925.574-2.981.574v2a9.976 9.976 0 003.727-.718l-.746-1.856zM17 15a8 8 0 01-8-8H7c0 5.523 4.477 10 10 10v-2zM9 7c0-1.056.204-2.061.574-2.981l-1.856-.746A9.975 9.975 0 007 7h2zm-5 5a8.003 8.003 0 015.019-7.426l-.746-1.856A10.003 10.003 0 002 12h2zm8 8a8 8 0 01-8-8H2c0 5.523 4.477 10 10 10v-2zm7.426-5.019A8.003 8.003 0 0112 20.001v2c4.207 0 7.805-2.599 9.282-6.274l-1.856-.746z"/>
    3  </svg>
    4  

/Users/zaydek/github/heroicons-viewer/src/components/heroicons/heroicons-2abb814/outline-md/md-phone.svg:
    1  <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
    2:   <path fill="#4A5568" d="M9.228 3.684L8.279 4l.949-.316zm1.498 4.493l-.949.316.949-.316zm-.502 1.21l.447.895-.447-.894zm-2.257 1.13l-.447-.895a1 1 0 00-.465 1.306l.912-.412zm5.516 5.516l-.41.912a1 1 0 001.305-.465l-.895-.447zm1.13-2.257l-.895-.447.894.447zm1.21-.502l-.316.949.316-.949zm4.493 1.498l.317-.949-.317.95zM5 2a3 3 0 00-3 3h2a1 1 0 011-1V2zm3.28 0H5v2h3.28V2zm1.897 1.368A2 2 0 008.279 2v2l1.898-.632zm1.497 4.493l-1.497-4.493L8.279 4l1.498 4.493 1.897-.632zm-1.002 2.421a2 2 0 001.002-2.421l-1.897.632.895 1.79zm-2.258 1.129l2.258-1.129-.895-1.789-2.257 1.13.894 1.788zm5.48 3.71a10.042 10.042 0 01-5.015-5.016l-1.824.822a12.042 12.042 0 006.018 6.018l.822-1.824zm-.176-1.793l-1.129 2.258 1.789.894 1.129-2.257-1.79-.895zm2.421-1.002a2 2 0 00-2.421 1.002l1.789.895.632-1.897zm4.494 1.497l-4.494-1.497-.632 1.897L20 15.72l.633-1.898zM22 15.721a2 2 0 00-1.367-1.898L20 15.721h2zM22 19v-3.28h-2V19h2zm-3 3a3 3 0 003-3h-2a1 1 0 01-1 1v2zm-1 0h1v-2h-1v2zM2 6c0 8.837 7.163 16 16 16v-2C10.268 20 4 13.732 4 6H2zm0-1v1h2V5H2z"/>
    3  </svg>
    4  

/Users/zaydek/github/heroicons-viewer/src/components/heroicons/heroicons-2abb814/outline-md/md-ticket.svg:
    1  <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
    2:   <path fill="#4A5568" d="M21 10v1a1 1 0 001-1h-1zm0 4h1a1 1 0 00-1-1v1zM3 14v-1a1 1 0 00-1 1h1zm0-4H2a1 1 0 001 1v-1zm2-6a3 3 0 00-3 3h2a1 1 0 011-1V4zm14 0H5v2h14V4zm3 3a3 3 0 00-3-3v2a1 1 0 011 1h2zm0 3V7h-2v3h2zm-2 2a1 1 0 011-1V9a3 3 0 00-3 3h2zm1 1a1 1 0 01-1-1h-2a3 3 0 003 3v-2zm1 4v-3h-2v3h2zm-3 3a3 3 0 003-3h-2a1 1 0 01-1 1v2zM5 20h14v-2H5v2zm-3-3a3 3 0 003 3v-2a1 1 0 01-1-1H2zm0-3v3h2v-3H2zm2-2a1 1 0 01-1 1v2a3 3 0 003-3H4zm-1-1a1 1 0 011 1h2a3 3 0 00-3-3v2zM2 7v3h2V7H2z"/>
    3    <path stroke-linecap="round" stroke-width="2" d="M15 5v2"/>
    4    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11v2M15 17v2"/>

4 matches across 4 files

And or open this Figma to see what I mean, visually.

I’m pretty sure only the following files are affected:

md-currency-dollar.svg
md-moon.svg
md-phone.svg
md-ticket.svg

In the meantime, I’ve made sure to add a little warning sign to those icons in my viewer.

Several icons seem to be mis-exported

The following solid icons seem to be mis-exported. If you look at the source code for those, you’ll see what I mean. There are hard-coded values, etc.

arrows-expand
fire
folder-add
folder-download
folder-remove
shopping-bag

Surprisingly, in the source for the GitHub SVGs things seem to be more or less correct, but everything is offset by the global viewbox, so they are unusable in their current state.

Also, arrows-expand uses a viewbox of 19 20 instead of 20 20.

Other than that I saw no problems with the rest of the icons and heroicons.dev is up to date. 👍

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.