Sha256: 46a636203e131ca3ecbe169f830ee592522b637088cd6fa54c7fd645bdb6e6be
Contents?: true
Size: 1.29 KB
Versions: 73
Compression:
Stored size: 1.29 KB
Contents
# frozen_string_literal: true module Primer module Alpha # @label UnderlinePanels class UnderlinePanelsPreview < ViewComponent::Preview # @label Playground # # @param number_of_panels [Integer] number # @param align [Symbol] select [left, right] def playground(number_of_panels: 3, align: :left) render(Primer::Alpha::UnderlinePanels.new(label: "Test navigation", align: align)) do |component| Array.new(number_of_panels || 3) do |i| component.with_tab(selected: i.zero?, id: "tab-#{i + 1}") do |tab| tab.with_panel { "Panel #{i + 1}" } tab.with_text { "Tab #{i + 1}" } end end end end # @label Default options # # @param number_of_panels [Integer] number # @param align [Symbol] select [left, right] def default(number_of_panels: 3, align: :left) render(Primer::Alpha::UnderlinePanels.new(label: "Test navigation", align: align)) do |component| Array.new(number_of_panels || 3) do |i| component.with_tab(selected: i.zero?, id: "tab-#{i + 1}") do |tab| tab.with_panel { "Panel #{i + 1}" } tab.with_text { "Tab #{i + 1}" } end end end end end end end
Version data entries
73 entries across 73 versions & 2 rubygems