跳到主要内容

Transitions

Bootstrap includes a few general use CSS transitions that can be applied to a number of components. React Bootstrap, bundles them up into a few composable <Transition> components from react-transition-group, a commonly used animation wrapper for React.

Encapsulating animations into components has the added benefit of making them more broadly useful, as well as portable for using in other libraries. All React-bootstrap components that can be animated, support pluggable <Transition> components.

Collapse

Basic Example

Add a collapse toggle animation to an element or component.

结果
Loading...
实时编辑器

Horizontal

Add a collapse toggle animation to an element or component to transition the width instead of height.

结果
Loading...
实时编辑器

Fade

Add a fade animation to a child element or component.

结果
Loading...
实时编辑器

API

Collapse

Fade