Accordion

This section previews the Accordion component.

I have implemented the accordion component into markdown which is ready to use.

Preview

Code Block

main.js
function isRocketAboutToCrash() {
    // Check if the rocket is stable
    if (!isStable()) {
        NoCrash(); // Prevent the crash
    }
}

Text with Markdown

Props

PropTypeDefaultDescription
titlestringnullThe value of Accordion title.
childrenReactNodenullFlexible content, both HTML elements, markdown componenst and plain text.
defaultOpenbooleanfalseYou can change the value to true if you want the content to open when the page loads

Code

<Accordion title="Markdown">
    this is an example of plain text content from the accordion component and below is markdown ;
    1. number one
    2. number two
    3. number three
</Accordion>

Published on Dec 22, 2024