@types/react-collapse
TypeScript icon, indicating that this package has built-in type declarations

5.0.4 • Public • Published

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

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

Credits

These definitions were written by Adam Binford, and Kristofer Giltvedt Selbekk.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/react-collapse

Weekly Downloads

63,726

Version

5.0.4

License

MIT

Unpacked Size

6.32 kB

Total Files

5

Last publish

Collaborators

  • types