Is it possible to use the Accordion outside of a form?
victor-britto-liax opened this issue · 1 comments
victor-britto-liax commented
Is there any way to use the accordion outside of the form? I wanted to use it in the view.
blocknotes commented
Hey, sorry to reply so late.
I found a problem with the accordions, it should be fixed with this PR: #10
About your question: you can do it using the Blaze CSS syntax (not with the gem helpers). Like in the docs.
Example:
# app/admin/dashboard.rb
ActiveAdmin.register_page "Dashboard" do
content title: proc { I18n.t("active_admin.dashboard") } do
div do
h3 'Test partial'
render partial: 'test_partial'
end
end
<!-- app/views/admin/dashboard/_test_partial.html.erb -->
<div class="c-card c-card--accordion u-high">
<input type="checkbox" id="accordion-1">
<label class="c-card__item" for="accordion-1">Item 1</label>
<div class="c-card__item">Pane 1</div>
<input type="checkbox" id="accordion-2">
<label class="c-card__item" for="accordion-2">Item 2</label>
<div class="c-card__item">Pane 2</div>
</div>