Class: Primer::TimelineItemComponent
- Includes:
- ViewComponent::Slotable
- Defined in:
- app/components/primer/timeline_item_component.rb
Overview
Use ‘TimelineItem` to display items on a vertical timeline, connected by badge elements.
Defined Under Namespace
Constant Summary
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Attribute Summary collapse
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
Instance Method Summary collapse
-
#initialize(condensed: false, **kwargs) ⇒ TimelineItemComponent
constructor
A new instance of TimelineItemComponent.
- #render? ⇒ Boolean
Methods included from FetchOrFallbackHelper
Methods included from ClassNameHelper
Constructor Details
#initialize(condensed: false, **kwargs) ⇒ TimelineItemComponent
Returns a new instance of TimelineItemComponent.
25 26 27 28 29 30 31 32 33 |
# File 'app/components/primer/timeline_item_component.rb', line 25 def initialize(condensed: false, **kwargs) @kwargs = kwargs @kwargs[:tag] = :div @kwargs[:classes] = class_names( "TimelineItem", condensed ? "TimelineItem--condensed" : "", kwargs[:classes] ) end |
Instance Attribute Details
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
12 13 14 |
# File 'app/components/primer/timeline_item_component.rb', line 12 def kwargs @kwargs end |
Instance Method Details
#render? ⇒ Boolean
35 36 37 |
# File 'app/components/primer/timeline_item_component.rb', line 35 def render? avatar.present? || badge.present? || body.present? end |