Class: Yattho::Beta::BorderBox::Header

Inherits:
Component
  • Object
show all
Defined in:
app/components/yattho/beta/border_box/header.rb

Overview

‘BorderBox::Header` is used inside `BorderBox` to render its header slot.

Constant Summary collapse

TITLE_TAG_FALLBACK =
:h2
TITLE_TAG_OPTIONS =
[:h1, TITLE_TAG_FALLBACK, :h3, :h4, :h5, :h6].freeze

Constants inherited from Component

Component::INVALID_ARIA_LABEL_TAGS

Constants included from Status::Dsl

Status::Dsl::STATUSES

Constants included from ViewHelper

ViewHelper::HELPERS

Constants included from TestSelectorHelper

TestSelectorHelper::TEST_SELECTOR_TAG

Constants included from FetchOrFallbackHelper

FetchOrFallbackHelper::InvalidValueError

Instance Method Summary collapse

Methods inherited from Component

deprecated?, generate_id

Methods included from JoinStyleArgumentsHelper

#join_style_arguments

Methods included from TestSelectorHelper

#add_test_selector

Methods included from FetchOrFallbackHelper

#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?

Methods included from ClassNameHelper

#class_names

Constructor Details

#initialize(**system_arguments) ⇒ Header

Returns a new instance of Header.

Examples:

Default


<%= render(Yattho::Beta::BorderBox::Header.new) do %>
  Header
<% end %>

with title

<%= render(Yattho::Beta::BorderBox::Header.new) do |h| %>
  <% h.with_title(tag: :h3) do %>I am a title<% end %>
<% end %>

Parameters:

  • system_arguments (Hash)

    <%= link_to_system_arguments_docs %>



41
42
43
44
45
46
47
48
# File 'app/components/yattho/beta/border_box/header.rb', line 41

def initialize(**system_arguments)
  @system_arguments = system_arguments
  @system_arguments[:tag] = :div
  @system_arguments[:classes] = class_names(
    "Box-header",
    system_arguments[:classes]
  )
end