This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@volvo-cars/accordion-component

0.0.5 • Public • Published

Accordion

Basic usage

<Accordion label="Accordion example">
  <Block as="p">...text</Block>
</Accordion>

Usage with parent state

const MultipleControlledAccordions = () => {
  const [active, setActive] = useState(-1);

  return (
    <>
      {times(4).map((d, i) => (
        <Accordion
          label={`Accordion example ${i + 1}`}
          key={i}
          onChange={() => setActive(i)}
          isOpen={i === active}
        >
          <Content />
        </Accordion>
      ))}
    </>
  );
};

Props

Props Type Description Required Default
label string Label ✔︎ null
children jsx Children for the Accordion's expandable content section ✔︎ null
onChange func Callback fired when accordion open state is changed null
extend object Extend styles of accordion null
extendContent object Extend styles of accordion content null

/@volvo-cars/accordion-component/

    Package Sidebar

    Install

    npm i @volvo-cars/accordion-component

    Weekly Downloads

    1

    Version

    0.0.5

    License

    UNLICENSED

    Unpacked Size

    9.65 kB

    Total Files

    3

    Last publish

    Collaborators

    • sylvainestevezvolvocars
    • allenbargi-vcc
    • jacobrask
    • glenashley
    • volvocars-uip-bot
    • alizeait
    • kristiankalb
    • samny_volvocars