Sha256: a54adb43a7a861ab73a04d37379111f4cb788c079e662d09b2c78d2e48f749da
Contents?: true
Size: 946 Bytes
Versions: 26
Compression:
Stored size: 946 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 = "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
26 entries across 26 versions & 1 rubygems