Class: Shadcn::TableRowComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/shadcn/table_row_component.rb

Overview

Table Row component

Constant Summary collapse

BASE_CLASSES =
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"

Instance Attribute Summary

Attributes inherited from BaseComponent

#class_name, #data, #html_options

Instance Method Summary collapse

Methods inherited from BaseComponent

#content

Methods included from Rails::Helpers::ClassNameHelper

#cn

Constructor Details

#initialize(selected: false, **options, &block) ⇒ TableRowComponent

Returns a new instance of TableRowComponent.

Parameters:

  • selected (Boolean) (defaults to: false)

    Whether row is selected



16
17
18
19
# File 'app/components/shadcn/table_row_component.rb', line 16

def initialize(selected: false, **options, &block)
  super(**options, &block)
  @selected = selected
end

Instance Method Details

#callObject



21
22
23
# File 'app/components/shadcn/table_row_component.rb', line 21

def call
  (:tr, row_content, row_attributes)
end