Class: PhlexKit::Label
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::Label
- 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
-
#initialize(**attrs) ⇒ Label
constructor
A new instance of Label.
- #view_template ⇒ Object
Methods inherited from BaseComponent
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_template ⇒ Object
10 11 12 |
# File 'app/components/phlex_kit/label/label.rb', line 10 def view_template(&) label(**mix({ class: "pk-label" }, @attrs), &) end |