Class: Primer::HeadingComponent
- Defined in:
- app/components/primer/heading_component.rb
Overview
Use the Heading component to wrap a component that will create a heading element
Constant Summary
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**system_arguments) ⇒ HeadingComponent
constructor
A new instance of HeadingComponent.
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Constructor Details
#initialize(**system_arguments) ⇒ HeadingComponent
Returns a new instance of HeadingComponent.
14 15 16 17 |
# File 'app/components/primer/heading_component.rb', line 14 def initialize(**system_arguments) @system_arguments = system_arguments @system_arguments[:tag] ||= :h1 end |
Instance Method Details
#call ⇒ Object
19 20 21 |
# File 'app/components/primer/heading_component.rb', line 19 def call render(Primer::BaseComponent.new(**@system_arguments)) { content } end |