An Alpine JS plugin to enhance the collapse directive. It seperates transform and opacity animations for a more organic transition.
<script defer src="https://unpkg.com/alpine-collapse-plus@latest/dist/collapse-plus.min.js"></script>
<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>
npm install alpine-collapse-plus
import Alpine from 'alpinejs'
import collapse from 'alpine-collapse-plus'
Alpine.plugin(collapse)
Alpine.start()
See index.html for an example with default settings.
-
duration
- The duration of the collapse/expand transition in milliseconds. See original Alpine.js collapse directive for more information. -
min
- The minimum height of the collapse/expand transition in pixels. See original Alpine.js collapse directive for more information. -
content-delay
- The delay of the opacity transition in milliseconds. -
content-duration
- The duration of the content opacity transition. -
content-duration-out
- The duration of the content opacity transition when closing. -
content-stagger
- The stagger interval