Sha256: 330cf12214fabd8f9f03462aa1031eb1e490a74dc68a757065e336e51f0de66c

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

module Yattho
  # @label LayoutComponent
  class LayoutComponentPreview < ViewComponent::Preview
    # @label Playground
    #
    # @param responsive [Boolean]
    # @param side [Symbol] select [left, right]
    # @param sidebar_col [Integer] select [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
    def playground(responsive: false, side: :right, sidebar_col: 3)
      render(Yattho::LayoutComponent.new(responsive: responsive, side: side, sidebar_col: sidebar_col)) do |component|
        component.with_main { "Main" }
        component.with_sidebar { "Sidebar" }
      end
    end

    # @label Default
    #
    # @param responsive [Boolean]
    # @param side [Symbol] select [left, right]
    # @param sidebar_col [Integer] select [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
    def default(responsive: false, side: :right, sidebar_col: 3)
      render(Yattho::LayoutComponent.new(responsive: responsive, side: side, sidebar_col: sidebar_col)) do |component|
        component.with_main { "Main" }
        component.with_sidebar { "Sidebar" }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yattho_view_components-0.1.1 previews/yattho/layout_component_preview.rb
yattho_view_components-0.0.1 previews/yattho/layout_component_preview.rb