Class: Plutonium::UI::PageHeader

Inherits:
Component::Base show all
Defined in:
lib/plutonium/ui/page_header.rb

Instance Method Summary collapse

Methods included from Component::Behaviour

#around_template

Methods included from Component::Tokens

#classes, #tokens

Methods included from Component::Kit

#BuildActionButton, #BuildActionsDropdown, #BuildBlock, #BuildBreadcrumbs, #BuildBulkActionsToolbar, #BuildColorModeSelector, #BuildDynaFrameContent, #BuildDynaFrameHost, #BuildEmptyCard, #BuildFrameNavigatorPanel, #BuildPageHeader, #BuildPanel, #BuildRowActionsDropdown, #BuildSkeletonTable, #BuildTabList, #BuildTableInfo, #BuildTablePagination, #BuildTableScopesBar, #BuildTableSearchBar, #method_missing, #respond_to_missing?

Constructor Details

#initialize(title:, description:, actions:) ⇒ PageHeader

Returns a new instance of PageHeader.



4
5
6
7
8
# File 'lib/plutonium/ui/page_header.rb', line 4

def initialize(title:, description:, actions:)
  @title = title
  @description = description
  @actions = actions || []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Plutonium::UI::Component::Kit

Instance Method Details

#view_templateObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/plutonium/ui/page_header.rb', line 10

def view_template
  div(class: "sm:flex sm:space-y-0 sm:gap-6 sm:flex-row items-center justify-between space-y-4 mb-8") {
    div {
      phlexi_render(@title) {
        render_title @title
      }

      phlexi_render(@description) {
        render_description @description
      }
    }
    render_actions if @actions.any?
  }
end