Ariadne

DetailsComponent

import Example from ‘../../src/@primer/gatsby-theme-doctocat/components/example’

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 :default and :none.
reset Boolean true If set to true, it will remove the default caret and remove style from the summary element
classes String "" Classes and attributes
attributes Hash {} Classes and attributes

Slots

Summary

Use the Summary as a trigger to reveal the content.

Name Type Default Description
button Boolean true Whether to render the Summary as a button or not.
classes String N/A Classes and attributes
attributes Hash N/A Classes and attributes

Body

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

Name Type Default Description
tag Symbol N/A The tag to use for the body/ One of :details-dialog, :details-menu, :div, or :ul.
classes String N/A Classes and attributes
attributes Hash N/A Classes and attributes

Examples

Default


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

Have questions?

Still have questions? Talk to support.