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, #BuildBlock, #BuildBreadcrumbs, #BuildColorModeSelector, #BuildDynaFrameContent, #BuildDynaFrameHost, #BuildEmptyCard, #BuildFrameNavigatorPanel, #BuildPageHeader, #BuildPanel, #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
24
25
# File 'lib/plutonium/ui/page_header.rb', line 10

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

      phlexi_render(@description) {
        render_description @description
      }
    }
    div(class: "flex flex-row space-x-2") {
      render_actions
    }
  }
end