Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Metronic according


Hello, I have a problem with the according in my app, I am pasting the code from the documentation, but after clicking on the according header it does not expand.
I'm using metronic 8 in react.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)


Hi,

First code example in the doc has an error I already included a fix for v8.0.34.

For now please use code example below:



<div className="accordion accordion-icon-toggle" id="kt_accordion_2">
<div className="accordion" id="kt_accordion_1">
<div className="accordion-item">
<h2 className="accordion-header" id="kt_accordion_1_header_1">
<button
className="accordion-button fs-4 fw-bold collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#kt_accordion_1_body_1"
aria-expanded="false"
aria-controls="kt_accordion_1_body_1"
>
Accordion Item #1
</button>
</h2>
<div
id="kt_accordion_1_body_1"
className="accordion-collapse collapse"
aria-labelledby="kt_accordion_1_header_1"
data-bs-parent="#kt_accordion_1"
>
<div className="accordion-body">
<strong>This is the first item"s accordion body.</strong>It is hidden by default,
until the collapse plugin adds the appropriate classes that we use to style each
element. These classes control the overall appearance, as well as the showing and
hiding via CSS transitions. You can modify any of this with custom CSS or overriding
our default variables. It"s also worth noting that just about any HTML can go within
the<code>.accordion-body</code>, though the transition does limit overflow.
</div>
</div>
</div>
<div className="accordion-item">
<h2 className="accordion-header" id="kt_accordion_1_header_2">
<button
className="accordion-button fs-4 fw-bold collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#kt_accordion_1_body_2"
aria-expanded="false"
aria-controls="kt_accordion_1_body_2"
>
Accordion Item #2
</button>
</h2>
<div
id="kt_accordion_1_body_2"
className="accordion-collapse collapse"
aria-labelledby="kt_accordion_1_header_2"
data-bs-parent="#kt_accordion_1"
>
<div className="accordion-body">
<strong>This is the second item"s accordion body.</strong>It is hidden by default,
until the collapse plugin adds the appropriate classes that we use to style each
element. These classes control the overall appearance, as well as the showing and
hiding via CSS transitions. You can modify any of this with custom CSS or overriding
our default variables. It"s also worth noting that just about any HTML can go within
the<code>.accordion-body</code>, though the transition does limit overflow.
</div>
</div>
</div>
<div className="accordion-item">
<h2 className="accordion-header" id="kt_accordion_1_header_3">
<button
className="accordion-button fs-4 fw-bold collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#kt_accordion_1_body_3"
aria-expanded="false"
aria-controls="kt_accordion_1_body_3"
>
Accordion Item #3
</button>
</h2>
<div
id="kt_accordion_1_body_3"
className="accordion-collapse collapse"
aria-labelledby="kt_accordion_1_header_3"
data-bs-parent="#kt_accordion_1"
>
<div className="accordion-body">
<strong>This is the third item"s accordion body.</strong>It is hidden by default,
until the collapse plugin adds the appropriate classes that we use to style each
element. These classes control the overall appearance, as well as the showing and
hiding via CSS transitions. You can modify any of this with custom CSS or overriding
our default variables. It"s also worth noting that just about any HTML can go within
the<code>.accordion-body</code>, though the transition does limit overflow.
</div>
</div>
</div>
</div>
</div>



Hi,

The first accordion example in react doc has an error, I already included fix into v8.0.34 release.

For now please use example shown below.

<div className="accordion accordion-icon-toggle" id="kt_accordion_2">
<div className="accordion" id="kt_accordion_1">
<div className="accordion-item">
<h2 className="accordion-header" id="kt_accordion_1_header_1">
<button
className="accordion-button fs-4 fw-bold collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#kt_accordion_1_body_1"
aria-expanded="false"
aria-controls="kt_accordion_1_body_1"
>
Accordion Item #1
</button>
</h2>
<div
id="kt_accordion_1_body_1"
className="accordion-collapse collapse"
aria-labelledby="kt_accordion_1_header_1"
data-bs-parent="#kt_accordion_1"
>
<div className="accordion-body">
ACCORDION1
</div>
</div>
</div>
<div className="accordion-item">
<h2 className="accordion-header" id="kt_accordion_1_header_2">
<button
className="accordion-button fs-4 fw-bold collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#kt_accordion_1_body_2"
aria-expanded="false"
aria-controls="kt_accordion_1_body_2"
>
Accordion Item #2
</button>
</h2>
<div
id="kt_accordion_1_body_2"
className="accordion-collapse collapse"
aria-labelledby="kt_accordion_1_header_2"
data-bs-parent="#kt_accordion_1"
>
<div className="accordion-body">
ACCORDION2
</div>
</div>
</div>
<div className="accordion-item">
<h2 className="accordion-header" id="kt_accordion_1_header_3">
<button
className="accordion-button fs-4 fw-bold collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#kt_accordion_1_body_3"
aria-expanded="false"
aria-controls="kt_accordion_1_body_3"
>
Accordion Item #3
</button>
</h2>
<div
id="kt_accordion_1_body_3"
className="accordion-collapse collapse"
aria-labelledby="kt_accordion_1_header_3"
data-bs-parent="#kt_accordion_1"
>
<div className="accordion-body">
ACCORDION3
</div>
</div>
</div>
</div>
</div>



The given solution did not bring anything, Accrording still does not work.



I just rechecked this example and it works fine in the latest Metronic version.

Can you please specify which version are you using?

If you made any changes in our codebase please describe them as well.

Thank you!


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(