Class: Primer::Beta::BorderBox::Header
- Defined in:
- app/components/primer/beta/border_box/header.rb
Overview
‘BorderBox::Header` is used inside `BorderBox` to render its header slot.
Constant Summary collapse
- TITLE_TAG_FALLBACK =
:h2
- TITLE_TAG_OPTIONS =
[:h1, TITLE_TAG_FALLBACK, :h3, :h4, :h5, :h6].freeze
Constants inherited from Component
Component::INVALID_ARIA_LABEL_TAGS
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Constants included from AttributesHelper
AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(**system_arguments) ⇒ Header
constructor
A new instance of Header.
Methods inherited from Component
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
Methods included from AttributesHelper
#aria, #data, #extract_data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes
Methods included from ExperimentalSlotHelpers
Methods included from ExperimentalRenderHelpers
Constructor Details
#initialize(**system_arguments) ⇒ Header
Returns a new instance of Header.
32 33 34 35 36 37 38 39 40 41 |
# File 'app/components/primer/beta/border_box/header.rb', line 32 def initialize(**system_arguments) @system_arguments = system_arguments @system_arguments[:id] ||= self.class.generate_id @system_arguments[:tag] = :div @system_arguments[:classes] = class_names( "Box-header", system_arguments[:classes] ) @id = @system_arguments[:id] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'app/components/primer/beta/border_box/header.rb', line 10 def id @id end |