Vue Custom Transition To Collapse Elements Horizontally Vertically

Vue Collapse Transition is a custom transition component that wraps the embedded transition. Collapses elements horizontally or vertically. Works with a fixed width or height and “auto”!

Must Read: A Lightweight Responsive Collapse Overflowing Table Columns Library | Podtablejs

How to make use of it:

Install and download:

# NPM
$ npm install @ivanv/vue-collapse-transition --save

1. Install and import the Vue Collapse Transition component.

import CollapseTransition from 'CollapseTransition'

2. Create a CollapseTransition component in your template.

<collapse-transition>
  <ul v-show="isOpen">
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  </ul>
</collapse-transition>

3. Enable the component.

export default {
  data() {
    return {
      isOpen = false, // closed by default
    }
  }
}

4. This component also supports horizontal collapse.

<collapse-transition dimension="width">
  <ul v-show="isOpen">
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  </ul>
</collapse-transition>

5. Configure the duration of the animation.

<collapse-transition :duration="300">
  <ul v-show="isOpen">
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  </ul>
</collapse-transition>

6. Apply the softening function to the transition.

<collapse-transition easing="ease-in-out">
  <ul v-show="isOpen">
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  <li>Example!</li>
  </ul>
</collapse-transition>

Options

☑️ Collapse Vertically or Horizontally

Set the dimension attribute to height or width.

☑️ Class Names

Vue will also set the usual transition classes. By default, the transition name is collapse, so the classes would be like collapse-enter and collapse-leave-to. You can choose another name if you wish.

☑️ Transition Duration

How long should the transition take in milliseconds?

☑️ Transition Easing

The CSS transition-timing-function (easing) to use.

See Demo And Download

vue-collapse-expand-transition

Official Website(ivanvermeyen): Click Here

This superior jQuery/javascript plugin is developed by ivanvermeyen. For extra advanced usage, please go to the official website.

Related Posts

drag-drop-file-5x5-jq-uploader

Responsive Drag and Drop File Uploader/Download Plugin | 5x5_jq_uploader

5x5_jq_uploader plugin can be used to instantly create a drop file area and file queue with a little bit of preparation. Bootstrap is used for responsive planning…

Bootstrap-Dark-Mode

Stylesheet For Implementing Dark Mode with Bootstrap

Bootstrap Dark Mode provides a style sheet and two texts that allow you to implement Dark Mode on your website. Initially loaded based on user preferences, can…

responsive-navigation-menu

Multi-purpose Navigation Menu for Javascript Library | jQuery Corenav

coreNavigation is a multipurpose navigation menu for a jquery based javascript library, comes with more style, and is easy to integrate. 11 Default Menu 2 Responsive Navigation…

Simple-Multi-Select-Dropdown-Pure-Vanilla-Javascript

Simple Multi-Select Dropdown Pure Vanilla Javascript | multiSelect.js

MultiSelect.js is a simple, clean, and progressive JavaScript library designed for easy integration with any type of project or system. The design was heavily influenced by the…

Confetti-Falling-Animation-Effect-party

Confetti Falling Animation Effect In JavaScript | party.js

Party.js is a JavaScript library to brighten user site experience with visual effects! Celebrate success with dom confetti! The library is written in TypeScript and compiled into…

how-to-create-popup-in-html-with-css

How To Create A Popup in HTML with CSS

How to create popup in html with css – Popup without JavaScript is an elegant pop-up panel component with an animated scale, written in CSS. Have you…

Leave a Reply

Your email address will not be published. Required fields are marked *