@bdt-component-library/accordion

Accordion component

Usage no npm install needed!

<script type="module">
  import bdtComponentLibraryAccordion from 'https://cdn.skypack.dev/@bdt-component-library/accordion';
</script>

README

Accordion Component

About

This is a component published as its own package from our component library monorepo: https://github.com/BenefitsDataTrust/ui-components. Setup instructions, as well as higher-level goals and concerns can be found from the main project README.

Description

Handles display of accordions according to style guide conventions.

API

prop type required default explanation
children React node yes n/a The components to render inside the accordion
className string no n/a Adds an optional classname to the component
variant enum("h2", "h3", "h5", "h5") no "h3" Changes typography style of the title prop
isOpen boolean no false Determines open state of accordion
title string no undefined Optional title for accordion
id string no n/a Adds an optional id to the children wrapper in the component