Skip to content

Use DetailsComponent to reveal content after clicking a button.

Arguments

NameTypeDefaultDescription
overlaySymbol:noneDictates the type of overlay to render with. One of :dark, :default, or :none.
resetBooleanfalseDefatuls to false. If set to true, it will remove the default caret and remove style from the summary element
system_argumentsHashN/ASystem arguments

Slots

Summary

Use the Summary slot as a trigger to reveal the content.

NameTypeDefaultDescription
buttonBooleantrueWhether to render the Summary as a button or not.
kwargsHashN/AThe same arguments as System arguments.

Body

Use the Body slot as the main content to be shown when triggered by the Summary.

NameTypeDefaultDescription
tagSymbol:divOne of :details-dialog, :details-menu, :div, or :ul.
kwargsHashN/AThe same arguments as System arguments.

Examples

Default

Summary
Body
<%= render Primer::DetailsComponent.new do |c| %>
<% c.summary do %>
Summary
<% end %>
<% c.body do %>
Body
<% end %>
<% end %>