Bootstrap

API collapse

CollapseConfig

interface

Configuration options for the collapse transition.

Properties
animationPendingClasses?

optional animationPendingClasses: string[]

the list of classes to add to the collapsable element while transitioning


dimension?

optional dimension: "height" | "width"

the direction in which the collapsing is performed


hideClasses?

optional hideClasses: string[]

the list of classes to add to the collapsable element when collapsed


showClasses?

optional showClasses: string[]

the list of classes to add to the collapsable element when shown


CollapseContext

interface

Represents the context for a collapsible element.

Properties
maxSize?

optional maxSize: string

the maximum size of the collapseable content.


minSize?

optional minSize: string

the minimum size of the collapseable content


collapseHorizontalTransition

constant

const collapseHorizontalTransition: TransitionFn

A transition function for collapsing elements horizontally.

This function is created using the createCollapseTransition utility and is configured with horizontalConfig.


collapseVerticalTransition

constant

const collapseVerticalTransition: TransitionFn

A transition function that handles vertical collapse animations.

This function is created using the createCollapseTransition utility with a vertical configuration. It is intended to be used for animating the collapsing and expanding of vertical elements.


createCollapseTransition

function

createCollapseTransition(config): TransitionFn

Create a collapse transition.

The transition attaches / removes classes during the different states of the collapse transition. It also updates the dimension value when reaching a non-pending state.

Parameters
config

CollapseConfig = {}

the collapse config

Returns

TransitionFn

the collapse transition