Icons
Icons are needed in almost any app. They add visual interest, while also helping users navigate your app easier.
Rails Designer uses the rails_icons gem to add icons to some of the component’s variants.
icon "x-mark", class: "size-4"
As rails_icons
gem is optional, Rails Designer will fallback to inline icons using Heroicons.
<<-SVG.html_safe
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon" class="size-4">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12"/>
</svg>
SVG