Class: Primer::SubheadComponent::Heading

Inherits:
ViewComponent::Slot
  • Object
show all
Includes:
ClassNameHelper
Defined in:
app/components/primer/subhead_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ClassNameHelper

#class_names

Constructor Details

#initialize(danger: false, **kwargs) ⇒ Heading

Returns a new instance of Heading.



54
55
56
57
58
59
60
61
62
# File 'app/components/primer/subhead_component.rb', line 54

def initialize(danger: false, **kwargs)
  @kwargs = kwargs
  @kwargs[:tag] ||= :div
  @kwargs[:classes] = class_names(
    @kwargs[:classes],
    "Subhead-heading",
    "Subhead-heading--danger": danger
  )
end

Instance Attribute Details

#kwargsObject (readonly)

Returns the value of attribute kwargs.



52
53
54
# File 'app/components/primer/subhead_component.rb', line 52

def kwargs
  @kwargs
end