Class: PhlexKit::SidebarMenuBadge

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/sidebar/sidebar_menu_badge.rb

Overview

Non-interactive count/status pinned to the right edge of a SidebarMenuItem, ported from shadcn/ui's SidebarMenuBadge. See sidebar.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ SidebarMenuBadge

Returns a new instance of SidebarMenuBadge.



5
6
7
# File 'app/components/phlex_kit/sidebar/sidebar_menu_badge.rb', line 5

def initialize(**attrs)
  @attrs = attrs
end

Instance Method Details

#view_template(&block) ⇒ Object



9
10
11
# File 'app/components/phlex_kit/sidebar/sidebar_menu_badge.rb', line 9

def view_template(&block)
  span(**mix({ class: "pk-sidebar-menu-badge" }, @attrs), &block)
end