1.1.0 • Published 6 years ago

height-zero2auto v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

height: 0px or other initial value | must auto

transitionDuration: number

transitionTimingFunction: 'linear' .... 1.1.0: fix when fold state can not sync 1.0.6: fix init render will auto spread

const { HeightZeroToAuto } = 'height-zero2auto';

function Demo(){
	const [isFold, setIsFold] = useState(true);
	return (
		<>
			<button
				onClick={()=>{
					setIsFold(!isFold);
				}}
			>FOLD</button>
			<div
			 style={{
				 border: '1px solid #000'
			 }}
			>
				<HeightZeroToAuto
					transitionDuration={400}
					transitionFunc={'ease'}
					height={isFold ? '0px': 'auto'}
				>
					<br />
					<br />
					<br />
					<br />
					<br />
					<br />
					<br />
				</HeightZeroToAuto>
			</div>
		</>
	)
}
1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago