# @types/react-collapse

> TypeScript definitions for react-collapse

Latest version **5.0.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/react-collapse
pnpm add @types/react-collapse
yarn add @types/react-collapse
bun add @types/react-collapse
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 5.0.4 |
| Published | 2023-11-07 |
| First published | 2018-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51434 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/react-collapse
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-collapse
- npm.io page: https://npm.io/package/@types/react-collapse

## Dependencies (1)

- [@types/react](https://npm.io/package/@types/react.md) *

## Recent versions

- 5.0.4 (latest) — 2023-11-07
- 5.0.1 (ts3.6) — 2021-07-07
- 5.0.0 (ts2.8) — 2019-11-15
- 4.0.1 (ts2.6) — 2018-02-12
- 4.0.0 (ts2.3) — 2018-01-05
- 5.0.3 — 2023-10-18
- 5.0.2 — 2023-09-27
- 4.0.2 — 2018-08-04

## README

# Installation
> `npm install --save @types/react-collapse`

# Summary
This package contains type definitions for react-collapse (https://github.com/nkbt/react-collapse).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-collapse.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-collapse/index.d.ts)
````ts
import * as React from "react";

export interface CollapseCallbackArgs {
    /** `true` only when Collapse reached final height */
    isFullyOpened: boolean;
    /** `true` only when Collapse is fully closed and height is zero */
    isFullyClosed: boolean;
    /** `true` if Collapse has any non-zero height */
    isOpened: boolean;
    /** current pixel height of Collapse container (changes until reaches `contentHeight`) */
    containerHeight: number;
    /** determined height of supplied Content */
    contentHeight: number;
}

export interface CollapseProps extends React.HTMLProps<Collapse> {
    /** Expands or collapses content. */
    isOpened: boolean;
    /** One or multiple children with static, variable or dynamic height. */
    children: React.ReactNode;
    /** It is possible to set className for extra div elements that ReactCollapse creates. */
    theme?: {
        collapse?: string | undefined;
        content?: string | undefined;
    } | undefined;
    /** Callback function triggered when animation has completed */
    onRest?: ((args: CollapseCallbackArgs) => void) | undefined;
    /** Callback function triggered when animation begins */
    onWork?: ((args: CollapseCallbackArgs) => void) | undefined;
    /** A way to control the initial element style. Will not be valid after the initial render */
    initialStyle?: {
        height?: string | number | undefined;
        overflow?: string | undefined;
    } | undefined;
    /** How often (in ms) the height of the content is checked. */
    checkTimeout?: number | undefined;
}

export class Collapse extends React.PureComponent<CollapseProps> {}

export class UnmountClosed extends React.PureComponent<CollapseProps> {}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/react](https://npmjs.com/package/@types/react)

# Credits
These definitions were written by [ Adam Binford](https://github.com/Kimahriman), and [Kristofer Giltvedt Selbekk](https://github.com/selbekk).

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