Sha256: a796ba42f335968b7a40e9024da733c12d4610c83f52d12194a7e897f35057e9
Contents?: true
Size: 902 Bytes
Versions: 2
Compression:
Stored size: 902 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 = "flex flex-col 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ariadne_view_components-0.0.6 | app/components/ariadne/body_component.rb |
ariadne_view_components-0.0.5 | app/components/ariadne/body_component.rb |