Sha256: 677dc588feadbdddec049de81ae3dcce529b9e7805fa0104149924fb2026d31b

Contents?: true

Size: 1.34 KB

Versions: 12

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

module Primer
  # @label SubheadComponent
  class SubheadComponentPreview < ViewComponent::Preview
    # @label Playground
    #
    # @param spacious [Boolean]
    # @param hide_border [Boolean]
    # @param heading_danger [Boolean]
    # @param heading_tag [Symbol] select [div, h1, h2, h3, h4, h5, h6]
    def playground(spacious: false, hide_border: false, heading_tag: :div, heading_danger: false)
      render(Primer::SubheadComponent.new(spacious: spacious, hide_border: hide_border)) do |component|
        component.with_heading(tag: heading_tag, danger: heading_danger) do
          "My Heading"
        end
        component.with_description do
          "My Description"
        end
      end
    end

    # @label Default Options
    #
    # @param spacious [Boolean]
    # @param hide_border [Boolean]
    # @param heading_danger [Boolean]
    # @param heading_tag [Symbol] select [div, h1, h2, h3, h4, h5, h6]
    def default(spacious: false, hide_border: false, heading_tag: :div, heading_danger: false)
      render(Primer::SubheadComponent.new(spacious: spacious, hide_border: hide_border)) do |component|
        component.with_heading(tag: heading_tag, danger: heading_danger) do
          "My Heading"
        end
        component.with_description do
          "My Description"
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
primer_view_components-0.0.116 previews/primer/subhead_component_preview.rb
primer_view_components-0.0.115 previews/primer/subhead_component_preview.rb
primer_view_components-0.0.114 previews/primer/subhead_component_preview.rb
primer_view_components-0.0.113 previews/primer/subhead_component_preview.rb
primer_view_components-0.0.112 previews/primer/subhead_component_preview.rb
primer_view_components-0.0.111 previews/primer/subhead_component_preview.rb
primer_view_components-0.0.110 previews/primer/subhead_component_preview.rb
primer_view_components-0.0.109 previews/primer/subhead_component_preview.rb
primer_view_components-0.0.108 previews/primer/subhead_component_preview.rb
primer_view_components-0.0.107 previews/primer/subhead_component_preview.rb
primer_view_components-0.0.106 previews/primer/subhead_component_preview.rb
primer_view_components-0.0.105 previews/primer/subhead_component_preview.rb