Sha256: d01b41907163522816d26336c7a939f8f70baaab50e78151efd7ba8d270a1248

Contents?: true

Size: 749 Bytes

Versions: 122

Compression:

Stored size: 749 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 = merge_class_names(
        DEFAULT_CLASSES,
        classes,
      )

      @attributes = attributes
    end
  end
end

Version data entries

122 entries across 122 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.45-x86_64-darwin app/components/ariadne/container_component.rb
ariadne_view_components-0.0.45-arm64-darwin app/components/ariadne/container_component.rb
ariadne_view_components-0.0.45-x86_64-linux app/components/ariadne/container_component.rb
ariadne_view_components-0.0.45-aarch64-linux app/components/ariadne/container_component.rb
ariadne_view_components-0.0.44-aarch64-linux app/components/ariadne/container_component.rb
ariadne_view_components-0.0.44-arm64-darwin app/components/ariadne/container_component.rb
ariadne_view_components-0.0.44-x86_64-linux app/components/ariadne/container_component.rb
ariadne_view_components-0.0.44-x86_64-darwin app/components/ariadne/container_component.rb
ariadne_view_components-0.0.44-x64-mingw-ucrt app/components/ariadne/container_component.rb
ariadne_view_components-0.0.44 app/components/ariadne/container_component.rb
ariadne_view_components-0.0.39-x86_64-darwin app/components/ariadne/container_component.rb
ariadne_view_components-0.0.39-x86_64-linux app/components/ariadne/container_component.rb
ariadne_view_components-0.0.39-x64-mingw32 app/components/ariadne/container_component.rb
ariadne_view_components-0.0.39-aarch64-linux app/components/ariadne/container_component.rb
ariadne_view_components-0.0.39-x64-mingw-ucrt app/components/ariadne/container_component.rb
ariadne_view_components-0.0.39-arm64-darwin app/components/ariadne/container_component.rb
ariadne_view_components-0.0.39 app/components/ariadne/container_component.rb
ariadne_view_components-0.0.38-x64-mingw32 app/components/ariadne/container_component.rb
ariadne_view_components-0.0.38-aarch64-linux app/components/ariadne/container_component.rb
ariadne_view_components-0.0.38-x86_64-darwin app/components/ariadne/container_component.rb