# @bolttech/atoms-collapse

> Certainly! Here's the README.md for the provided `Collapse` component:

Latest version **0.22.2** (published 2026-06-08) · 0 weekly downloads

## Install

```sh
npm install @bolttech/atoms-collapse
pnpm add @bolttech/atoms-collapse
yarn add @bolttech/atoms-collapse
bun add @bolttech/atoms-collapse
```

## Health

**Score 50/100 (C)** — status: active.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.22.2 |
| Published | 2026-06-08 |
| First published | 2023-05-19 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 52.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | andsfranbolt, danielkhalebbatista, pauloazevedo-ed, bruno.gomes, plinio.altoe, joaoteixeira20, esteve-cabrera, jabolttech, lucasvpaiva, herberts.fortuna, matheus.maciel.bolttech, silas.silva.bolttech |

## Links

- npm: https://www.npmjs.com/package/@bolttech/atoms-collapse
- npm.io page: https://npm.io/package/@bolttech/atoms-collapse

## Dependencies (6)

- [react](https://npm.io/package/react.md) 19.1.2
- [styled-components](https://npm.io/package/styled-components.md) 6.1.1
- [@bolttech/ui-utils](https://npm.io/package/@bolttech/ui-utils.md) 0.6.7
- [@bolttech/atoms-icon](https://npm.io/package/@bolttech/atoms-icon.md) 0.24.9
- [@material-symbols/font-300](https://npm.io/package/@material-symbols/font-300.md) ^0.5.5
- [@bolttech/frontend-foundations](https://npm.io/package/@bolttech/frontend-foundations.md) 0.12.3

## Recent versions

- 0.22.2 (latest) — 2026-06-08
- 0.22.0 — 2026-04-08
- 0.20.0 — 2026-03-06
- 0.19.1 — 2024-12-12
- 0.19.0 — 2024-12-05
- 0.18.0 — 2024-09-24
- 0.17.0 — 2024-09-04
- 0.16.0 — 2024-07-24
- 0.15.2 — 2024-06-07
- 0.15.1 — 2024-05-10
- 0.15.0 — 2024-04-01
- 0.14.2 — 2024-03-04
- 0.14.1 — 2024-01-17
- 0.0.1 — 2024-01-17
- 0.14.0 — 2023-11-21
- … 18 more at https://npm.io/package/@bolttech/atoms-collapse/versions

## README

Certainly! Here's the README.md for the provided `Collapse` component:

# Collapse Component

A React component to create collapsible sections with headers and content.

## Installation

Use the package manager [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/) to install the component.

```bash
npm install @bolttech/frontend-foundations @bolttech/atoms-collapse
```

or

```bash
yarn add @bolttech/frontend-foundations @bolttech/atoms-collapse
```

## Props

The `Collapse` component accepts the following properties:

| Prop        | Type          | Description                                                                                            |
|-------------|---------------|--------------------------------------------------------------------------------------------------------|
| titleText   | `string`      | The text content of the collapse header.                                                              |
| isOpen      | `boolean`     | Determines whether the collapse is open or closed.                                                    |
| imgCollapse | `string` or `element` | An image URL or an element to be displayed as the collapse header icon.                      |
| status      | `string`      | The status of the collapse (e.g., `'default'`, `'error'`, `'success'`).                               |
| onClick     | `function`    | Callback function to handle the collapse header click event.                                          |
| children    | `node`        | The content to be displayed within the collapsed section.                                            |
| dataTestId  | `string`      | The `data-testid` attribute for testing.                                                               |
| variant  | `string`      | Size variant a prop that should be the value 'small' or 'large'                                                               |
| icons  | `Icons`      | Icons referenced with status                                                               |

## Usage

```jsx
import React, {useState} from 'react';
import {Collapse} from '@bolttech/atoms-collapse';
import {bolttechTheme, BolttechThemeProvider} from "@bolttech/frontend-foundations";

const ExampleComponent = () => {
  const [isCollapseOpen, setIsCollapseOpen] = useState(false);

  const handleCollapseClick = (isOpen) => {
    setIsCollapseOpen(isOpen);
  };

  return (
    <BolttechThemeProvider theme={bolttechTheme}>
      <Collapse
        titleText="Section Title"
        isOpen={isCollapseOpen}
        imgCollapse="https://example.com/collapse-icon.png"
        status="default"
        onClick={handleCollapseClick}
        dataTestId="custom-collapse"
      >
        {/* Content to display within the collapsed section */}
      </Collapse>
    </BolttechThemeProvider>
  );
};

export default ExampleComponent;
```

## Contributing

Contributions are welcome! For any bug fixes, improvements, or new features, please open an [issue](link-to-issues) or submit a pull request.

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

---
_Source: https://npm.io/package/@bolttech/atoms-collapse · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
