Guide
Components
One component per rails_icons library, all subclasses of Glyphs::Icon.
Library components#
| Component | rails_icons library |
|---|---|
LucideIcon | lucide |
PhosphorIcon | phosphor |
HeroIcon | heroicons |
TablerIcon | tabler |
FeatherIcon | feather |
BoxIcon | boxicons |
FlagIcon | flags |
HugeIcon | hugeicons |
LinearIcon | linear |
RadixIcon | radix |
SidekickIcon | sidekickicons |
WeatherIcon | weather |
AnimatedIcon | animated |
AnimatedIcon renders the spinners bundled inside the icons gem itself (faded-spinner, trailing-spinner, fading-dots, bouncing-dots) — nothing to sync.
Kit mechanics#
Each component is a tiny Glyphs::Icon subclass that pins its library. Because Glyphs extends Phlex::Kit, including it gives you the capitalized call form; outside a kit context, instantiate directly:
# Inside a component that includes Glyphs:
LucideIcon(:house, class: "size-4")
# Anywhere else:
render Glyphs::LucideIcon.new(:house, class: "size-4")
Glyphs::LucideIcon.new(:house).call # => "<svg ...>" (standalone string)Rendered SVGs are memoized per [library, variant, name, attributes] in a per-process cache — repeated renders of the same icon skip the file read and Nokogiri parse. Disable with config.cache_svgs = false.