Sha256: 01970033d97ae3ae8579b0c9d2612e34f1b8d2fb1d66645ed1cd0bd7cf5de47d
Contents?: true
Size: 1.11 KB
Versions: 3
Compression:
Stored size: 1.11 KB
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&.to_i || 3) do |i| component.with_item(href: "##{i}") { "Breadcrumb Item #{i + 1}" } end end end # @label Default options # # @param number_of_links [Integer] number # @snapshot def default(number_of_links: 2) render(Primer::Beta::Breadcrumbs.new) do |component| Array.new(number_of_links&.to_i || 3) do |i| component.with_item(href: "##{i}") { "Breadcrumb Item #{i + 1}" } end end end # @label WithBetaTruncate # @snapshot def with_beta_truncate render_with_template end # @label WithDeprecatedTruncate # @snapshot def with_deprecated_truncate render_with_template end end end end
Version data entries
3 entries across 3 versions & 2 rubygems