class Primer::Beta::Details

Use ‘DetailsComponent` to reveal content after clicking a button.

def initialize(overlay: NO_OVERLAY, reset: false, disabled: false, **system_arguments)

Parameters:
  • system_arguments (Hash) -- <%= link_to_system_arguments_docs %>
  • disabled (Boolean) -- Whether or not to disable the summary button.
  • reset (Boolean) -- Defaults to false. If set to true, it will remove the default caret and remove style from the summary element
  • overlay (Symbol) -- Dictates the type of overlay to render with. <%= one_of(Primer::Beta::Details::OVERLAY_MAPPINGS.keys) %>
def initialize(overlay: NO_OVERLAY, reset: false, disabled: false, **system_arguments)
  @system_arguments = deny_tag_argument(**system_arguments)
  @system_arguments[:tag] = :details
  @system_arguments[:classes] = class_names(
    system_arguments[:classes],
    OVERLAY_MAPPINGS[fetch_or_fallback(OVERLAY_MAPPINGS.keys, overlay, NO_OVERLAY)],
    "details-reset" => reset
  )
  @disabled = disabled
  @summary_info = nil
end

def render?

def render?
  summary.present? && body.present?
end