JSFiddle - React, Tailwind, and code Playground
HTML
<label for="click-me">Click ME</label><input type="checkbox" id="click-me">
<ul>
<li>Menu item 1</li>
<li>Menu item 2</li>
<li>Menu item 3</li>
<li>Menu item 4</li>
<li>Menu item 5</li>
<li>Menu item 6</li>
</ul>
CSS
ul {
margin: 3em 0;
}
ul li {
transition-duration: 800ms;
}
li:nth-child(1) { transform: translateY(-100%); }
li:nth-child(2) { transform: translateY(-200%); }
li:nth-child(3) { transform: translateY(-300%); }
li:nth-child(4) { transform: translateY(-400%); }
li:nth-child(5) { transform: translateY(-500%); }
li:nth-child(6) { transform: translateY(-600%); }
input[type=checkbox]:checked + ul li:nth-child(1) { transition-delay:2000ms; }
input[type=checkbox]:checked + ul li:nth-child(2) { transition-delay:1600ms; }
input[type=checkbox]:checked + ul li:nth-child(3) { transition-delay:1200ms; }
input[type=checkbox]:checked + ul li:nth-child(4) { transition-delay: 800ms; }
input[type=checkbox]:checked + ul li:nth-child(5) { transition-delay: 400ms; }
input[type=checkbox]:checked + ul li:nth-child(6) { transition-delay: 0ms; }
input[type=checkbox]:checked + ul li { transform: none }
JavaScript
$("li").click(function () {
var prev = $(this).prevAll();
$.unique(prev).each(function (i) {
$(this).slideUp(function () {
$(this).appendTo(this.parentNode).slideDown();
});
});
});