Sha256: 4b53be19e5acc55b518dacd25edee66984fafe36a892bcaf45a6f0a370abfccb

Contents?: true

Size: 743 Bytes

Versions: 148

Compression:

Stored size: 743 Bytes

Contents

# frozen_string_literal: true

module Ariadne
  # The container wraps the majority, if not all, of the content on a page.
  class ContainerComponent < Ariadne::Component
    DEFAULT_CLASSES = "ariadne-px-4 sm:ariadne-px-6 lg:ariadne-px-8"

    # @example Default
    #   <%= render(Ariadne::ContainerComponent.new) do |container| %>
    #     <%= render(Ariadne::ButtonComponent.new) { "Click me!" } %>
    #   <% end %>
    #
    # @param classes [String] <%= link_to_classes_docs %>
    # @param attributes [Hash] <%= link_to_attributes_docs %>
    def initialize(classes: "", attributes: {})
      @tag = :div
      @classes = class_names(
        DEFAULT_CLASSES,
        classes,
      )

      @attributes = attributes
    end
  end
end

Version data entries

148 entries across 148 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.34 app/components/ariadne/container_component.rb
ariadne_view_components-0.0.34-x86_64-linux app/components/ariadne/container_component.rb
ariadne_view_components-0.0.34-x86_64-darwin app/components/ariadne/container_component.rb
ariadne_view_components-0.0.34-x64-mingw32 app/components/ariadne/container_component.rb
ariadne_view_components-0.0.34-x64-mingw-ucrt app/components/ariadne/container_component.rb
ariadne_view_components-0.0.34-arm64-darwin app/components/ariadne/container_component.rb
ariadne_view_components-0.0.34-aarch64-linux app/components/ariadne/container_component.rb
ariadne_view_components-0.0.33 app/components/ariadne/container_component.rb
ariadne_view_components-0.0.33-x86_64-linux app/components/ariadne/container_component.rb
ariadne_view_components-0.0.33-x86_64-darwin app/components/ariadne/container_component.rb
ariadne_view_components-0.0.33-x64-mingw32 app/components/ariadne/container_component.rb
ariadne_view_components-0.0.33-x64-mingw-ucrt app/components/ariadne/container_component.rb
ariadne_view_components-0.0.33-arm64-darwin app/components/ariadne/container_component.rb
ariadne_view_components-0.0.33-aarch64-linux app/components/ariadne/container_component.rb
ariadne_view_components-0.0.32 app/components/ariadne/container_component.rb
ariadne_view_components-0.0.32-x86_64-linux app/components/ariadne/container_component.rb
ariadne_view_components-0.0.32-x86_64-darwin app/components/ariadne/container_component.rb
ariadne_view_components-0.0.32-x64-mingw32 app/components/ariadne/container_component.rb
ariadne_view_components-0.0.32-x64-mingw-ucrt app/components/ariadne/container_component.rb
ariadne_view_components-0.0.32-arm64-darwin app/components/ariadne/container_component.rb