Use DetailsComponent
to reveal content after clicking a button.
Arguments
Name | Type | Default | Description |
---|
overlay | Symbol | :none | Dictates the type of overlay to render with. One of :dark , :default , or :none . |
reset | Boolean | false | Defaults to false. If set to true, it will remove the default caret and remove style from the summary element |
system_arguments | Hash | N/A | System arguments |
Slots
Summary
Use the Summary slot as a trigger to reveal the content.
Name | Type | Default | Description |
---|
button | Boolean | true | Whether to render the Summary as a button or not. |
kwargs | Hash | N/A | The same arguments as System arguments. |
Body
Use the Body slot as the main content to be shown when triggered by the Summary.
Name | Type | Default | Description |
---|
tag | Symbol | :div | One of :details-dialog , :details-menu , :div , or :ul . |
kwargs | Hash | N/A | The same arguments as System arguments. |
Examples
Default
<%= render Primer::DetailsComponent.new do |c| %>
<% c.summary do %>
Summary
<% end %>
<% c.body do %>
Body
<% end %>
<% end %>