Class: Ariadne::GridComponent
- Defined in:
- app/components/ariadne/grid_component.rb
Overview
Arranges items as a ariadne-grid.
Defined Under Namespace
Classes: GridItem
Constant Summary collapse
- DEFAULT_CLASSES =
"ariadne-grid ariadne-gap-6 sm:ariadne-grid-cols-2 lg:ariadne-grid-cols-3"- DEFAULT_LINK_COLOR_CLASSES =
"focus:ariadne-outline-none focus:ariadne-ring-2 focus:ariadne-ring-offset-2 focus:ariadne-ring-purple-500"
Constants inherited from Component
Component::BASE_BODY_CLASSES, Component::BASE_HTML_CLASSES, Component::BASE_MAIN_CLASSES, Component::BASE_WRAPPER_CLASSES, Component::INVALID_ARIA_LABEL_TAGS
Constants included from ActionViewExtensions::FormHelper
ActionViewExtensions::FormHelper::DEFAULT_FORM_CLASSES
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::INTEGER_TYPES, FetchOrFallbackHelper::InvalidValueError, FetchOrFallbackHelper::TRUE_OR_FALSE
Instance Method Summary collapse
-
#initialize(classes: "", attributes: {}) ⇒ GridComponent
constructor
A new instance of GridComponent.
Methods included from ActionViewExtensions::FormHelper
Methods included from ClassNameHelper
Methods included from LoggerHelper
#logger, #silence_deprecations?, #silence_warnings?
Methods included from FetchOrFallbackHelper
#check_incoming_attribute, #check_incoming_tag, #check_incoming_value, #fetch_or_raise, #fetch_or_raise_boolean, #fetch_or_raise_integer
Constructor Details
#initialize(classes: "", attributes: {}) ⇒ GridComponent
Returns a new instance of GridComponent.
19 20 21 22 23 24 25 26 27 |
# File 'app/components/ariadne/grid_component.rb', line 19 def initialize(classes: "", attributes: {}) @classes = class_names( DEFAULT_CLASSES, classes, ) default_attributes = { role: "list" } @attributes = default_attributes.merge(attributes) end |