Module: Backpack::Attributes

Extended by:
ActiveSupport::Concern, Literal::Properties
Included in:
Components::Base
Defined in:
lib/backpack/attributes.rb

Overview

Provides root attributes management tools:

  • pass an ‘attributes` prop, to specify HTML attributes on the root element

  • ‘root_attributes` returns a mix of attributes for the root element

  • ‘extra_root_attributes` to be overridden in components

Constant Summary collapse

MandatoryHTMLAttribute =
_Union(
  true,
  false,
  Date,
  Time,
  String,
  Symbol,
  Float,
  Integer,
  _Array(
    _Deferred { HTMLAttribute }
  ),
  _Hash(
    _Union(String, Symbol),
    _Deferred { HTMLAttribute }
  )
)
HTMLAttribute =
_Nilable(MandatoryHTMLAttribute)
HTMLAttributes =
_Hash(Symbol, HTMLAttribute)