Sha256: b590c8767bcc7c9bda1d685693770e342a16e05e426cb7d4626e307adc9dda7e

Contents?: true

Size: 853 Bytes

Versions: 20

Compression:

Stored size: 853 Bytes

Contents

# frozen_string_literal: true

module Primer
  module Beta
    # @label Breadcrumbs
    class BreadcrumbsPreview < ViewComponent::Preview
      # @label Playground
      #
      # @param number_of_links [Integer] number
      def playground(number_of_links: 2)
        render(Primer::Beta::Breadcrumbs.new) do |component|
          Array.new(number_of_links || 3) do |i|
            component.with_item(href: "##{i}") { "Breadcrumb Item #{i + 1}" }
          end
        end
      end

      # @label Default options
      #
      # @param number_of_links [Integer] number
      def default(number_of_links: 2)
        render(Primer::Beta::Breadcrumbs.new) do |component|
          Array.new(number_of_links || 3) do |i|
            component.with_item(href: "##{i}") { "Breadcrumb Item #{i + 1}" }
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
primer_view_components-0.3.1 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.3.0 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.2.0 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.1.9 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.1.8 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.1.7 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.1.6 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.1.5 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.1.4 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.1.3 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.1.2 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.1.1 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.1.0 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.0.123 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.0.122 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.0.121 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.0.120 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.0.119 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.0.118 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.0.117 previews/primer/beta/breadcrumbs_preview.rb