Class: PhlexKit::FieldLegend
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::FieldLegend
- Defined in:
- app/components/phlex_kit/field/field_legend.rb
Overview
Constant Summary collapse
- VARIANTS =
{ legend: "legend", label: "label" }.freeze
Instance Method Summary collapse
-
#initialize(variant: :legend, **attrs) ⇒ FieldLegend
constructor
A new instance of FieldLegend.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(variant: :legend, **attrs) ⇒ FieldLegend
Returns a new instance of FieldLegend.
8 9 10 11 |
# File 'app/components/phlex_kit/field/field_legend.rb', line 8 def initialize(variant: :legend, **attrs) @variant = variant.to_sym @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
13 14 15 |
# File 'app/components/phlex_kit/field/field_legend.rb', line 13 def view_template(&) legend(**mix({ class: "pk-field-legend #{fetch_option(VARIANTS, @variant, :variant)}" }, @attrs), &) end |