Guide

Components

One component per rails_icons library, all subclasses of Glyphs::Icon.

Library components#

Componentrails_icons library
LucideIconlucide
PhosphorIconphosphor
HeroIconheroicons
TablerIcontabler
FeatherIconfeather
BoxIconboxicons
FlagIconflags
HugeIconhugeicons
LinearIconlinear
RadixIconradix
SidekickIconsidekickicons
WeatherIconweather
AnimatedIconanimated

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.