Class: UI::FieldLegend
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::FieldLegend
- Includes:
- FieldLegendBehavior
- Defined in:
- app/components/ui/field_legend.rb
Overview
Legend - Phlex implementation
Legend element for FieldSet with variant support. Uses FieldLegendBehavior concern for shared styling logic.
Instance Method Summary collapse
-
#initialize(variant: "legend", classes: "", **attributes) ⇒ FieldLegend
constructor
A new instance of FieldLegend.
- #view_template(&block) ⇒ Object
Methods included from FieldLegendBehavior
#field_legend_classes, #field_legend_html_attributes
Constructor Details
#initialize(variant: "legend", classes: "", **attributes) ⇒ FieldLegend
Returns a new instance of FieldLegend.
19 20 21 22 23 |
# File 'app/components/ui/field_legend.rb', line 19 def initialize(variant: "legend", classes: "", **attributes) @variant = variant @classes = classes @attributes = attributes end |
Instance Method Details
#view_template(&block) ⇒ Object
25 26 27 28 29 |
# File 'app/components/ui/field_legend.rb', line 25 def view_template(&block) legend(**field_legend_html_attributes) do yield if block_given? end end |