Hello Team,
Is there any way where we can add a link/button to the accordion header?
Hi,
Could you please describe in more detail what you are trying to achieve?
You can check bootstrap accordion doc page:
https://getbootstrap.com/docs/5.0/components/accordion/
Regards,
Lauris Stepanovs,
Keenthemes Support Team
Hello,
I am trying to add a clickable button to the accordion header after the title is there any way I can achieve this?
Hi,
You can add a button outside of the accordion header.
<div class="mb-5">
<div class="d-flex">
<div
class="py-3 me-5 d-flex"
data-bs-toggle="collapse"
data-bs-target="#kt_accordion"
>
<span class="accordion-icon">
<span class="svg-icon svg-icon-3">
<inline-svg src="media/icons/duotune/arrows/arr064.svg" />
</span>
</span>
<h3 class="fs-4 text-gray-800 fw-bold mb-0 ms-4">
Accordion header text
</div>
<button
@click.stop="buttonClick()"
data-bs-parent="#myGroup"
class="btn btn-xs btn-primary"
>
You button
</button>
</div>
<div
class="fs-6 collapse show ps-10"
data-bs-parent="#kt_accordion"
>
Accordion content
</div>
</div>
Hello,
Thanks for the reply!
Is it possible to add links/buttons to this accordion?
https://preview.keenthemes.com/html/metronic/docs/base/accordion#basic
Hi,
Yes, you can achieve this as shown below.
<!--begin::Accordion-->
<div class="accordion" >
<div class="accordion-item">
<h2 class="accordion-header" >
<div
class="accordion-button fs-4 fw-semibold"
type="button"
data-bs-toggle="collapse"
data-bs-target="#kt_accordion_1_body_1"
aria-expanded="true"
aria-controls="kt_accordion_1_body_1"
>
Accordion Item #1
<button data-bs-toggle="collapse" @click="buttonClick()">
You button text
</button>
</div>
</h2>
<div
class="accordion-collapse collapse show"
aria-labelledby="kt_accordion_1_header_1"
data-bs-parent="#kt_accordion_1"
>
<div class="accordion-body">...</div>
</div>
</div>
</div>
<!--end::Accordion-->