Class: PhlexKit::ComboboxBadge

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/combobox/combobox_badge.rb

Overview

Selected-value chip, ported from ruby_ui's RubyUI::ComboboxBadge. The controller builds chips with this class into the ComboboxBadgeTrigger's container client-side; render the component directly when server-rendering an initial selection. See combobox.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ ComboboxBadge

Returns a new instance of ComboboxBadge.



7
8
9
# File 'app/components/phlex_kit/combobox/combobox_badge.rb', line 7

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

Instance Method Details

#view_templateObject



11
12
13
# File 'app/components/phlex_kit/combobox/combobox_badge.rb', line 11

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