Class: ColumnsComponentPreview
- Inherits:
-
ViewComponent::Preview
- Object
- ViewComponent::Preview
- ColumnsComponentPreview
- Defined in:
- lib/cubit_components/previews/columns_component_preview.rb
Instance Method Summary collapse
-
#default ⇒ Object
Two equal columns, default layout.
-
#reversed_and_collapsing ⇒ Object
Reversed order & collapses below md.
Instance Method Details
#default ⇒ Object
Two equal columns, default layout
5 6 7 8 9 10 11 |
# File 'lib/cubit_components/previews/columns_component_preview.rb', line 5 def default render(CubitComponents::ColumnsComponent.new(vattrs: %w[gap-medium])) do tag.div("Col 1", class: "w-1/3") + tag.div("Col 2", class: "w-1/6") + tag.div("Col 3", class: "w-1/2") end end |
#reversed_and_collapsing ⇒ Object
Reversed order & collapses below md
14 15 16 17 18 19 |
# File 'lib/cubit_components/previews/columns_component_preview.rb', line 14 def reversed_and_collapsing render(CubitComponents::ColumnsComponent.new(reverse: true, collapse_below: "md", vattrs: %w[gap-large items-center])) do tag.div("First", class: "w-full") + tag.div("Second", class: "w-full") end end |