Class: PhlexKit::InputGroup

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

Overview

Input with attached addons, ported from shadcn/ui's InputGroup: a bordered shell that focuses as one control; compose InputGroupAddon(align:) around a plain PhlexKit::Input (its own border/bg collapse inside the group). .pk-input-group* (input_group.css).

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ InputGroup

Returns a new instance of InputGroup.



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

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

Instance Method Details

#view_templateObject



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

def view_template(&)
  div(**mix({ class: "pk-input-group", role: "group" }, @attrs), &)
end