Class: RubyUIAdmin::UI::Icon
- Defined in:
- app/components/ruby_ui_admin/ui/icon.rb
Overview
Inline Lucide icons (lucide.dev, ISC license) — vendored as SVG paths so the gem
needs no icon dependency. Add entries to render_paths as needed.
render RubyUIAdmin::UI::Icon.new(:eye)
render RubyUIAdmin::UI::Icon.new(:trash, class: "size-5")
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(name, **attrs) ⇒ Icon
constructor
A new instance of Icon.
- #view_template ⇒ Object
Constructor Details
#initialize(name, **attrs) ⇒ Icon
Returns a new instance of Icon.
11 12 13 14 |
# File 'app/components/ruby_ui_admin/ui/icon.rb', line 11 def initialize(name, **attrs) @name = name.to_sym super(**attrs) end |
Instance Method Details
#view_template ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/components/ruby_ui_admin/ui/icon.rb', line 16 def view_template svg( xmlns: "http://www.w3.org/2000/svg", viewbox: "0 0 24 24", fill: "none", stroke: "currentColor", stroke_width: "2", stroke_linecap: "round", stroke_linejoin: "round", **attrs ) { |s| render_paths(s) } end |