Class: Polaris::Card::HeaderComponent

Inherits:
Polaris::Component
  • Object
show all
Defined in:
app/components/polaris/card/header_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(title: "", actions: [], **system_arguments) ⇒ HeaderComponent

Returns a new instance of HeaderComponent.



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/components/polaris/card/header_component.rb', line 2

def initialize(
  title: "",
  actions: [],
  **system_arguments
)
  @system_arguments = system_arguments
  @system_arguments[:tag] = :div
  @system_arguments[:classes] = class_names(
    @system_arguments[:classes],
    "Polaris-LegacyCard__Header"
  )

  @title = title
  @actions = actions.map { |a| a.merge(plain: true) }
end

Instance Method Details

#simple?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/components/polaris/card/header_component.rb', line 18

def simple?
  content.blank? && @actions.blank?
end