15 lines
431 B
JavaScript
15 lines
431 B
JavaScript
import React from "react"
|
|
import * as accordionStyles from "./accordion.module.css"
|
|
|
|
export default function Accordion({ title, children }) {
|
|
return (
|
|
<div>
|
|
<input type="checkbox" id={`tab-${title}`} name={`tab-${title}`} />
|
|
<label htmlFor={`tab-${title}`} className={accordionStyles.header}>
|
|
{title}
|
|
</label>
|
|
<section className={accordionStyles.content}>{children}</section>
|
|
</div>
|
|
)
|
|
}
|