tailwindlabs / heroicons

A set of free MIT-licensed high-quality SVG icons for UI development.
https://heroicons.com
MIT License
21.03k stars 1.27k forks source link

Copy JSX button copies SVG #840

Closed thelamina closed 1 year ago

thelamina commented 1 year ago

Hey,

I noticed the button Copy JSX does not copy the actual JSX element but copies the SVG element instead.

Cheers.

adamwathan commented 1 year ago

Hey! It copies the SVG as JSX, which is the intended behavior. You’ll notice it’s using className, strokeWidth, etc, which are the changes needed to use the icon as inline JSX.

ericvanular commented 1 year ago

Thanks for the clarification. Currently, it's necessary to go hunt down the exact React component name at https://unpkg.com/browse/@heroicons/react@2.0.12, which feels clunky (unless I'm missing an easier way)

adamwathan commented 1 year ago

The React icon name is just the PascalCase version of the icon name you see on the site 👍🏻

So academic-cap is AcademicCap for example.