Class: Primer::SubheadComponent
- Defined in:
- app/components/primer/subhead_component.rb
Overview
Use the Subhead component for page headings.
Constant Summary
Constants included from Primer::Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
-
#initialize(spacious: false, hide_border: false, **system_arguments) ⇒ SubheadComponent
constructor
A new instance of SubheadComponent.
- #render? ⇒ Boolean
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(spacious: false, hide_border: false, **system_arguments) ⇒ SubheadComponent
Returns a new instance of SubheadComponent.
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'app/components/primer/subhead_component.rb', line 83 def initialize(spacious: false, hide_border: false, **system_arguments) @system_arguments = system_arguments @system_arguments[:tag] = :div @system_arguments[:classes] = class_names( @system_arguments[:classes], "Subhead hx_Subhead--responsive", "Subhead--spacious": spacious, "border-bottom-0": hide_border ) @system_arguments[:mb] ||= hide_border ? 0 : nil end |
Instance Method Details
#render? ⇒ Boolean
97 98 99 |
# File 'app/components/primer/subhead_component.rb', line 97 def render? heading.present? end |