Class: SolidWebUi::Ui::TableComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/solid_web_ui/ui/table_component.rb

Overview

A styled data table. Pass column ‘headers`; render the body rows as the component’s content (a block of <tr> rows). Shows an empty state when no rows are given.

Instance Method Summary collapse

Constructor Details

#initialize(headers:, empty_message: "Nothing to show.") ⇒ TableComponent

Returns a new instance of TableComponent.



9
10
11
12
# File 'app/components/solid_web_ui/ui/table_component.rb', line 9

def initialize(headers:, empty_message: "Nothing to show.")
  @headers = headers
  @empty_message = empty_message
end