Sha256: ec213fbc6cc4582c3eeb6baf2ff1e830f277ea7bb9231ff67c4de44d48bbc52f
Contents?: true
Size: 927 Bytes
Versions: 14
Compression:
Stored size: 927 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 BodyComponent < Ariadne::Component DEFAULT_CLASSES = "ariadne-flex ariadne-flex-col ariadne-min-h-screen" # @example Default # # <%= render(Ariadne::BodyComponent.new) { "Example" } %> # # @param classes [String] <%= link_to_classes_docs %> # @param attributes [Hash] <%= link_to_attributes_docs %> def initialize(classes: "", attributes: {}) @tag = :body @classes = class_names( DEFAULT_CLASSES, classes, ) @attributes = attributes end def call render(Ariadne::BaseComponent.new(tag: @tag, classes: @classes, attributes: @attributes)) { content } end end end
Version data entries
14 entries across 14 versions & 1 rubygems