Class: PhlexKit::Label

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

Overview

Standalone form label, ported from shadcn/ui's Label (FormFieldLabel is the ruby_ui-shaped equivalent inside a FormField). Pass for: to bind it. .pk-label (label.css).

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ Label

Returns a new instance of Label.



6
7
8
# File 'app/components/phlex_kit/label/label.rb', line 6

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

Instance Method Details

#view_templateObject



10
11
12
# File 'app/components/phlex_kit/label/label.rb', line 10

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