Accordion
When you want to say a lot but not all at once
Includes a Ruby component and corresponding Rails helper
RubyIncludes a Stimulus controller
StimulusExample
<%= nk_accordion do |a| %>
<%= a.item do %>
<%= a.trigger "Item 1" %>
<%= a.content do %>
<p>Content</p>
<% end %>
<% end %>
<%= a.item do %>
<%= a.trigger "Item 2" %>
<%= a.content do %>
<p>Content</p>
<% end %>
<% end %>
<% end %>
Usage
| ||
---|---|---|
Property | Default | Description |
**attrs | HTML attributes for <div> element |
| ||
---|---|---|
Property | Default | Description |
**attrs | HTML attributes for <div> element |
| ||
---|---|---|
Property | Default | Description |
text | nil | Plain text content |
**attrs | HTML attributes for <button> element |
| ||
---|---|---|
Property | Default | Description |
text | nil | Plain text content |
**attrs | HTML attributes for <div> element |