0.22.2 • Published 2 months ago

@bolttech/atoms-accordion v0.22.2

Weekly downloads
-
License
-
Repository
-
Last release
2 months ago

Accordion Component

A simple accordion component for displaying collapsible content.

Installation

Use the package manager npm or yarn to install the component.

npm install @bolttech/frontend-foundations @bolttech/atoms-accordion

or

yarn add @bolttech/frontend-foundations @bolttech/atoms-accordion

Props

The Accordion component accepts the following properties:

PropTypeDescription
headerTextstringThe text to be displayed as the accordion header.
showContentbooleanControls whether the content is shown or hidden.
contentTextstringThe text to be displayed as the accordion content.
disabledbooleanDisables the accordion interaction when set to true.
iconstringThe name of the icon to be displayed next to the header text.
onClickfunctionCallback function to toggle the showContent state.
idstringAn optional identifier to differentiate between multiple instances of the accordion (for testing, etc.).

Usage

import React, { useState } from 'react';
import { Accordion } from '@bolttech/atoms-accordion';
import { bolttechTheme } from '@bolttech/frontend-foundations';

const ExampleComponent = () => {
  const [showContent, setShowContent] = useState(false);

  const handleToggleContent = (value) => {
    setShowContent(value);
  };

  return (
    <BolttechThemeProvider theme={bolttechTheme}>
      <Accordion headerText="Accordion Header" showContent={showContent} contentText="Accordion Content" icon="expand_more" onClick={handleToggleContent} id="unique-accordion-id" />
    </BolttechThemeProvider>
  );
};

export default ExampleComponent;

Contributing

Contributions are welcome! For any bug fixes, improvements, or new features, please open an issue or submit a pull request.

Please make sure to follow the code standards and test your changes before submitting.

0.22.2

2 months ago

0.22.1

4 months ago

0.21.0

6 months ago

0.20.0

7 months ago

0.19.0

8 months ago

0.11.0

10 months ago

0.12.0

10 months ago

0.13.0

9 months ago

0.14.0

9 months ago

0.15.0

9 months ago

0.16.0

9 months ago

0.17.0

9 months ago

0.18.0

8 months ago

0.17.1

9 months ago

0.22.0

6 months ago

0.21.1

6 months ago

0.9.0

10 months ago

0.8.0

10 months ago

0.6.2

10 months ago

0.7.0

10 months ago

0.5.0

11 months ago

0.6.1

11 months ago

0.6.0

11 months ago

0.4.2

11 months ago

0.3.0

12 months ago

0.2.1

12 months ago

0.4.1

11 months ago

0.4.0

11 months ago

0.1.10

1 year ago

0.0.1

1 year ago

0.2.0

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago