Web · Paper-fold accordion
Fold
Panels unfold like paper.
An accordion whose panels unfold like folded paper. Leaves swing down from alternating creases and catch the light as they flatten.
Demo
A recording of the demo. Open it in a new tab
What it does
- 01
Content is sliced into leaves that rotate in 3D from alternating creases
- 02
Light and shade on each leaf follow its angle
- 03
Spring physics, so opening and closing can be interrupted mid-fold
- 04
Real buttons with arrow-key navigation; find-in-page opens the matching answer
Use it
git clone https://github.com/YagnikBarasiya23/fold-accordion.git
# copy fold.js and fold.css into your project<link rel="stylesheet" href="fold.css">
<div id="faq">
<div class="fold-item">
<h3><button class="fold-trigger" aria-expanded="false">Question</button></h3>
<div class="fold-panel">
<div class="fold-content">Answer…</div>
</div>
</div>
</div>
<script type="module">
import Fold from './fold.js';
const faq = new Fold(document.querySelector('#faq'), { single: true });
</script>Every option, the technique behind the motion and the accessibility notes are in the README on GitHub
More components
All 10- Web
- Web
Get in touch
Open for freelance projects, contract roles and collaborations — mobile apps and full-stack products in particular. WhatsApp gets the fastest reply.
- Phone
- +91 70488 09875
- Based in
- Rajkot, Gujarat, India
- Elsewhere