Sha256: 3e92b7ead67ee11bac702802866b56776ba458a0630bfcc0d7d2a58b3bcb713f

Contents?: true

Size: 729 Bytes

Versions: 26

Compression:

Stored size: 729 Bytes

Contents

# frozen_string_literal: true

module Primer
  # `Box` is a basic wrapper component for most layout related needs.
  class BoxComponent < Primer::Component
    status :stable

    # @example Default
    #   <%= render(Primer::BoxComponent.new) { "Your content here" } %>
    #
    # @example Color and padding
    #   <%= render(Primer::BoxComponent.new(bg: :subtle, p: 3)) { "Hello world" } %>
    #
    # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
    def initialize(**system_arguments)
      @system_arguments = deny_tag_argument(**system_arguments)

      @system_arguments[:tag] = :div
    end

    def call
      render(Primer::BaseComponent.new(**@system_arguments)) { content }
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
primer_view_components-0.0.87 app/components/primer/box_component.rb
primer_view_components-0.0.86 app/components/primer/box_component.rb
primer_view_components-0.0.85 app/components/primer/box_component.rb
primer_view_components-0.0.84 app/components/primer/box_component.rb
primer_view_components-0.0.83 app/components/primer/box_component.rb
primer_view_components-0.0.82 app/components/primer/box_component.rb
primer_view_components-0.0.81 app/components/primer/box_component.rb
primer_view_components-0.0.80 app/components/primer/box_component.rb
primer_view_components-0.0.79 app/components/primer/box_component.rb
primer_view_components-0.0.78 app/components/primer/box_component.rb
primer_view_components-0.0.77 app/components/primer/box_component.rb
primer_view_components-0.0.76 app/components/primer/box_component.rb
primer_view_components-0.0.75 app/components/primer/box_component.rb
primer_view_components-0.0.74 app/components/primer/box_component.rb
primer_view_components-0.0.73 app/components/primer/box_component.rb
primer_view_components-0.0.72 app/components/primer/box_component.rb
primer_view_components-0.0.71 app/components/primer/box_component.rb
primer_view_components-0.0.70 app/components/primer/box_component.rb
primer_view_components-0.0.69 app/components/primer/box_component.rb
primer_view_components-0.0.68 app/components/primer/box_component.rb