woocommerce/packages/js/experimental/src/vertical-css-transition
Christopher Allford d2d8d78be1 Moved WCA Packages
This commit moves all of the packages in
`plugins/woocommerce-admin/packages` to their
new home in `packages/js`.
2022-03-18 14:25:26 -07:00
..
stories Moved WCA Packages 2022-03-18 14:25:26 -07:00
test Moved WCA Packages 2022-03-18 14:25:26 -07:00
README.md Moved WCA Packages 2022-03-18 14:25:26 -07:00
index.ts Moved WCA Packages 2022-03-18 14:25:26 -07:00
vertical-css-transition.tsx Moved WCA Packages 2022-03-18 14:25:26 -07:00

README.md

VerticalCSSTransition

This is a wrapper to the React CSSTransition component, allowing for each vertical height transitions (collapsing/expanding). CSS does not support height: auto transitions, this uses JavaScript instead.

Usage

<VerticalCSSTransition timeout={ 500 } in={ true } classNames="my-node" defaultStyle={ transitionProperty: 'max-height, opacity' }>
	<div>some content</div>
	<div>
		some more content <br /> line 2 <br /> line 3
	</div>
</VerticalCSSTransition>
.my-node-enter {
	opacity: 0;
}

.my-node-enter-active {
	opacity: 1;
}

Props

Props extends the CSSTransition props.

Name Type Default Description
defaultStyle CSSProperties null Custom CSS properties for the transition component.

defaultStyle

defaultStyle is used to extend the current list of CSS properties added by this component. It also allows you to add extra transition properties by overwriting the transitionProperty property (see above for example).