class UiBibz::Ui::Core::Boxes::Components::CardHeader

Create a card header

Attributes

Options

You can add HTML attributes using the html_options. You can pass arguments in options attribute:

Signatures

UiBibz::Ui::Core::Boxes::CardHeader.new(content, options = nil, html_options = nil)

UiBibz::Ui::Core::Boxes::CarHeader.new(options = nil, html_options = nil) do
  content
end

Examples

UiBibz::Ui::Core::Boxes::CardHeader.new.render

UiBibz::Ui::Core::Boxes::CardHeader.new do
  'Exemple'
end.render

UiBibz::Ui::Core::Boxes::CardHeader.new(tap: true) do |h|
  h.tab_group do |tg|
    tg.tab 'link', url: '#link"
    tg.tab 'link', url: '#link"
  end
end.render

Public Instance Methods

pre_render() click to toggle source

Render html tag

# File lib/ui_bibz/ui/core/boxes/components/card_header.rb, line 46
def pre_render
  content_tag :div, glyph_and_content_html, html_options
end
tab_group(content = nil, options = nil, html_options = nil, &block) click to toggle source
# File lib/ui_bibz/ui/core/boxes/components/card_header.rb, line 50
def tab_group(content = nil, options = nil, html_options = nil, &block)
  @content = if tapped?(block)
               CardTabGroup.new(content, options, html_options).tap(&block).render
             else
               CardTabGroup.new(content, options, html_options, &block).render
             end
end

Private Instance Methods

component_html_classes() click to toggle source
# File lib/ui_bibz/ui/core/boxes/components/card_header.rb, line 60
def component_html_classes
  ['card-header', outline]
end
outline() click to toggle source
# File lib/ui_bibz/ui/core/boxes/components/card_header.rb, line 64
def outline
  "text-#{@options[:status]} border-#{@options[:status]} bg-transparent" if @options[:outline]
end