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.

html
<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

AttributeDefaultWhat it does
nameThe 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.
size24Width and height in px
colorthe text colorAny CSS color. Without it the icon follows the surrounding text color.
strokethe icon's ownStroke width of outline icons
animateoffrd 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.
speed12 is twice as fast. Needs animate.
labelnoneAccessible 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

html
<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-src and connect-src.
  • To remove the dependency on this website, copy the icon as SVG from its page instead.