Class: Shadcn::Table::Component
- Inherits:
-
ApplicationViewComponent
- Object
- ViewComponent::Base
- ApplicationViewComponent
- Shadcn::Table::Component
- Defined in:
- app/components/shadcn/table/component.rb
Overview
Port of registry/new-york-v4/ui/table.tsx
shadcn always wraps the table in a scroll container carrying
data-slot="table-container".
Constant Summary collapse
- CONTAINER_CLASSES =
"relative w-full overflow-x-auto"
Constants inherited from ApplicationViewComponent
ApplicationViewComponent::CONTENTS_STYLE, ApplicationViewComponent::VOID_TAGS
Instance Attribute Summary
Attributes inherited from ApplicationViewComponent
Instance Method Summary collapse
Methods inherited from ApplicationViewComponent
#css_classes, default_tag, #element_attributes, #initialize, #merged_style, #render_element, #shadcn_t, slot_name, #style_variants, #tag_name
Constructor Details
This class inherits a constructor from Shadcn::ApplicationViewComponent
Instance Method Details
#call ⇒ Object
19 20 21 22 23 |
# File 'app/components/shadcn/table/component.rb', line 19 def call tag.div("data-slot": "table-container", class: CONTAINER_CLASSES) do render_element(body: content) end end |