Class: BetterUi::Table::HeaderComponent

Inherits:
ApplicationComponent show all
Defined in:
app/components/better_ui/table/header_component.rb

Overview

A table header row component that renders a <tr> element with header cell slots.

Used within TableComponent’s <thead> section for slot-based table construction. Header cells are rendered as <th> elements with appropriate styling.

Examples:

Header with cells

<% t.with_header do |h| %>
  <% h.with_cell(label: "Name") %>
  <% h.with_cell(label: "Email") %>
  <% h.with_cell(label: "Actions", align: :right) %>
<% end %>

Constant Summary

Constants inherited from ApplicationComponent

ApplicationComponent::SHADOWS, ApplicationComponent::VARIANTS, ApplicationComponent::VARIANT_BODY_DIVIDE, ApplicationComponent::VARIANT_DIVIDE, ApplicationComponent::VARIANT_HEADER_BG, ApplicationComponent::VARIANT_HEADER_TEXT, ApplicationComponent::VARIANT_HIGHLIGHTED, ApplicationComponent::VARIANT_HOVERABLE, ApplicationComponent::VARIANT_RING, ApplicationComponent::VARIANT_SORT_ICON, ApplicationComponent::VARIANT_STRIPED

Instance Method Summary collapse

Constructor Details

#initialize(size: :md, variant: :primary, style: :default, container_classes: nil) ⇒ HeaderComponent

Returns a new instance of HeaderComponent.



21
22
23
24
25
26
# File 'app/components/better_ui/table/header_component.rb', line 21

def initialize(size: :md, variant: :primary, style: :default, container_classes: nil)
  @size = size
  @variant = variant
  @style = style
  @container_classes = container_classes
end