homepage/src/components/accordion.js

15 lines
431 B
JavaScript
Raw Normal View History

2020-01-14 19:55:53 +00:00
import React from "react"
import * as accordionStyles from "./accordion.module.css"
export default function Accordion({ title, children }) {
return (
2020-01-14 19:55:53 +00:00
<div>
2020-01-23 21:06:44 +00:00
<input type="checkbox" id={`tab-${title}`} name={`tab-${title}`} />
2020-01-14 19:55:53 +00:00
<label htmlFor={`tab-${title}`} className={accordionStyles.header}>
{title}
</label>
2020-01-23 21:06:44 +00:00
<section className={accordionStyles.content}>{children}</section>
2020-01-14 19:55:53 +00:00
</div>
)
}