Embed with a script tag
For a plain HTML page, a CMS or a site with no build step: add one script and use <rd-icon> anywhere. It works with any of the 19 libraries, and the rd icons can move.
<script src="https://rdicons.vimalbhatt.com/embed.js" defer></script>
<rd-icon name="bell"></rd-icon>
<rd-icon name="bell" animate></rd-icon>
<rd-icon name="lucide:house" size="32" color="#4f46e5"></rd-icon>Attributes
| Attribute | Default | What it does |
|---|---|---|
name | The icon. bell means the rd library; use library:icon for the others, for example lucide:house or tabler:home. Run npx rdicons search or open an icon page to find names. | |
size | 24 | Width and height in px |
color | the text color | Any CSS color. Without it the icon follows the surrounding text color. |
stroke | the icon's own | Stroke width of outline icons |
animate | off | rd icons only. Empty or hover: plays when hovered. parent: plays when the element around it (a button or link) is hovered. play: plays once on load. loop: repeats. |
speed | 1 | 2 is twice as fast. Needs animate. |
label | none | Accessible name. Without it the icon is hidden from screen readers (use it for icons that are not next to text). |
Animate when a button is hovered
<button>
<rd-icon name="bell" animate="parent"></rd-icon> Notifications
</button>Notes
- The script is about 3 KB. Each icon is fetched once from this website and cached by the browser and a CDN, so it suits a handful of icons per page. For many icons or an app, use the React, Vue and Svelte packages, or copy the SVG.
- Animation stops for people who set reduced motion on their device.
- Icons keep their own license; read Icon licenses. Solar needs credit.
- If your site uses a Content Security Policy, allow this website in
script-srcandconnect-src. - To remove the dependency on this website, copy the icon as SVG from its page instead.