class Primer::Alpha::StackItem

StackItem is a layout component designed to be used as the child of a Stack.

def initialize(tag: DEFAULT_TAG, grow: false, **system_arguments)

Parameters:
  • system_arguments (Hash) -- <%= link_to_system_arguments_docs %>
  • grow (Boolean) -- Allow item to keep size or expand to fill the available space.
  • tag (Symbol) -- Customize the element type of the rendered container.
def initialize(tag: DEFAULT_TAG, grow: false, **system_arguments)
  @tag = tag
  @grow = grow
  @system_arguments = system_arguments
  @system_arguments[:tag] = tag
  @system_arguments[:classes] = class_names(
    @system_arguments.delete(:classes),
    "StackItem"
  )
  @system_arguments[:data] = merge_data(
    @system_arguments, {
      data: {
        **GrowArg.for(grow).to_data_attributes
      }
    }
  )
end