Class: Polaris::HeadingComponent
- Inherits:
-
Component
- Object
- Component
- Polaris::HeadingComponent
- Defined in:
- app/components/polaris/heading_component.rb
Constant Summary collapse
- ELEMENT_DEFAULT =
:h2- ELEMENT_OPTIONS =
%i[p h1 h2 h3 h4 h5 h6]
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(element: ELEMENT_DEFAULT, **system_arguments) ⇒ HeadingComponent
constructor
A new instance of HeadingComponent.
Constructor Details
#initialize(element: ELEMENT_DEFAULT, **system_arguments) ⇒ HeadingComponent
Returns a new instance of HeadingComponent.
8 9 10 11 12 13 14 |
# File 'app/components/polaris/heading_component.rb', line 8 def initialize( element: ELEMENT_DEFAULT, **system_arguments ) @system_arguments = system_arguments @element = element end |
Instance Method Details
#call ⇒ Object
16 17 18 |
# File 'app/components/polaris/heading_component.rb', line 16 def call render(Polaris::TextComponent.new(as: @element, variant: :headingMd, **@system_arguments)) { content } end |