1.1.0 • Published 5 years ago

height-zero2auto v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 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

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago