tailwindlabs / heroicons

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

Cant copy JSX when copying code from site. #559

Closed kritik-sah closed 2 years ago

kritik-sah commented 2 years ago

there are two option Copy Svg or Copy Jsx on site copy JSx is not working

benrudolphWSP commented 2 years ago

Same here. It just copies SVG even if you click the JSX button. I've tried on the latest release of Chrome and Edge.

Anishpras commented 2 years ago

Can I work on this issue?

reinink commented 2 years ago

Hey folks! I just left a comment on a related PR which explains how the copy feature is intended to work: https://github.com/tailwindlabs/heroicons.com/pull/93#issuecomment-1013696646

TLDR; The "Copy JSX" button provides a JSX compatible version of the SVG — the class attribute is converted to className.

Hope that helps 👍

2018eeb1139 commented 6 months ago

not working as of now always SVG is copied everytime. sometimes it is very irritated.

markbolster12 commented 5 months ago

My understanding is there are React components created to use - what is the recommended way to find the name of these components, and why would we need svg compatible with JSX when the component already exists?