Class: RubyUI::SidebarMenuSkeleton
- Defined in:
- lib/ruby_ui/sidebar/sidebar_menu_skeleton.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(show_icon: false, **attrs) ⇒ SidebarMenuSkeleton
constructor
A new instance of SidebarMenuSkeleton.
- #view_template ⇒ Object
Constructor Details
#initialize(show_icon: false, **attrs) ⇒ SidebarMenuSkeleton
Returns a new instance of SidebarMenuSkeleton.
5 6 7 8 |
# File 'lib/ruby_ui/sidebar/sidebar_menu_skeleton.rb', line 5 def initialize(show_icon: false, **attrs) @show_icon = show_icon super(**attrs) end |
Instance Method Details
#view_template ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ruby_ui/sidebar/sidebar_menu_skeleton.rb', line 10 def view_template(&) div(**attrs) do Skeleton(class: "size-4 rounded-md", data: {sidebar: "menu-skeleton-icon"}) if @show_icon Skeleton( class: "h-4 max-w-[var(--skeleton-width)] flex-1", data: {sidebar: "menu-skeleton-text"}, style: {"--skeleton-width" => "#{skeleton_width}%"} ) end end |