Sha256: b47f7d8d5573a5186b1681ffafb19d74c5f1745f05651cf0fe0baacf231f7299
Contents?: true
Size: 955 Bytes
Versions: 7
Compression:
Stored size: 955 Bytes
Contents
# frozen_string_literal: true module Ariadne # Add a general description of component here # Add additional usage considerations or best practices that may aid the user to use the component correctly. # @accessibility Add any accessibility considerations class MainComponent < Ariadne::Component DEFAULT_CLASSES = "ariadne-flex-auto" # @example Default # # <%= render(Ariadne::MainComponent.new) { "Example" } %> # # @param classes [String] <%= link_to_classes_docs %> # @param attributes [Hash] <%= link_to_attributes_docs %> def initialize(classes: "", attributes: {}) @tag = :main @classes = class_names( DEFAULT_CLASSES, classes, ) @attributes = attributes end def call render(Ariadne::BaseComponent.new(tag: @tag, classes: @classes, attributes: @attributes)) do render(Ariadne::ContainerComponent.new) { content } end end end end
Version data entries
7 entries across 7 versions & 1 rubygems