All Projects → ivanvermeyen → vue-collapse-transition

ivanvermeyen / vue-collapse-transition

Licence: MIT License
Custom Vue transition to collapse elements horizontally or vertically. Works with both fixed and 'auto' width or height.

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to vue-collapse-transition

Accordion-Collapse-react-native
React native Accordion/Collapse component, very good to use in toggles & show/hide content
Stars: ✭ 147 (+104.17%)
Mutual labels:  collapse
sidebar-menu
jQuery sidebar-menu component
Stars: ✭ 77 (+6.94%)
Mutual labels:  collapse
JSONPreview
🎨 A view that previews JSON in highlighted form, it also provides the ability to format and collapse nodes.
Stars: ✭ 21 (-70.83%)
Mutual labels:  collapse
FiniteStateMachine
This project is a finite state machine designed to be used in games.
Stars: ✭ 45 (-37.5%)
Mutual labels:  transition
utransition
A tiny (~2KB) library providing you an easy way to manage time-based transitions
Stars: ✭ 22 (-69.44%)
Mutual labels:  transition
SHTransition
SHTransition is a simple library for viewcontroller transition animation in swift.
Stars: ✭ 35 (-51.39%)
Mutual labels:  transition
react-scrolling-color-background
background with color transitioning as you scroll, declarative and easy to setup
Stars: ✭ 53 (-26.39%)
Mutual labels:  transition
react-layout-transition
Trying to make layout transitions simple
Stars: ✭ 57 (-20.83%)
Mutual labels:  transition
vue-router-view-transition
Properly time out-in transitions with scrollBehavior
Stars: ✭ 38 (-47.22%)
Mutual labels:  transition
react-collapse-pane
The splittable, draggable, collapsible panel layout library 🎉
Stars: ✭ 156 (+116.67%)
Mutual labels:  collapse
ux-lab
No description or website provided.
Stars: ✭ 49 (-31.94%)
Mutual labels:  transition
angular-app
Angular 14 ,Bootstrap 5, Node.js, Express.js, ESLint, CRUD, PWA, SSR, SEO, Universal, Lazy Loading
Stars: ✭ 389 (+440.28%)
Mutual labels:  collapse
Accordion.JS
Accordion.JS: Free jQuery Accordion plugin
Stars: ✭ 34 (-52.78%)
Mutual labels:  collapse
anim8js
The ultimate animation library for javascript - animate everything!
Stars: ✭ 33 (-54.17%)
Mutual labels:  transition
django-logic
Django Logic - easy way to implement state-based business logic with pure functions
Stars: ✭ 44 (-38.89%)
Mutual labels:  transition
postcss-will-change-transition
PostCSS plugin to add will-change property after transition declarations
Stars: ✭ 15 (-79.17%)
Mutual labels:  transition
animated
🌊 Implicit animations for JavaFX.
Stars: ✭ 79 (+9.72%)
Mutual labels:  transition
Ease-Transitions-System
Unity system to easily test and apply ease transitions/tweens to component values
Stars: ✭ 31 (-56.94%)
Mutual labels:  transition
react-collapsed
A React custom-hook for creating flexible and accessible expand/collapse components.
Stars: ✭ 392 (+444.44%)
Mutual labels:  collapse
drain-js
Makes smooth transitions between two numbers.
Stars: ✭ 45 (-37.5%)
Mutual labels:  transition

Vue Collapse Transition

Vue2 Version Downloads License

This custom VueJS transition component wraps the built-in transition. It collapses elements horizontally or vertically. Works with both fixed and 'auto' width or height!

👁 Demo

You can find a quick demo to play with on CodePen.

📦 Install

Using NPM:

npm i @ivanv/vue-collapse-transition

Via CDN:

<script src="https://unpkg.com/@ivanv/vue-collapse-transition"></script>

🛠 Usage

Wrap the container you wish to make collapsable with the <collapse-transition> tag.

When you toggle the v-show boolean value, the transition will automatically trigger.

<template>
  <div>
    <button @click="isOpen = !isOpen">
      Toggle
    </button>
    
    <collapse-transition>
      <div v-show="isOpen">
        This div will open and close smoothly!
      </div>
    </collapse-transition>
  </div>
</template>

<script>
  import { CollapseTransition } from "@ivanv/vue-collapse-transition"
  
  export default {
    components: {
      CollapseTransition,
    },
    data() {
      return {
        isOpen: false, // closed by default
      }
    }
  }
</script>

It's up to you how you want to position the collapsable element with CSS.

⚙️ Options

☑️ Collapse Vertically or Horizontally

Set the dimension attribute to height or width.

Default: height

<collapse-transition dimension="height">
  <!-- ... -->
</collapse-transition>

If you collapse the width of a container, the content of its children might wrap on new lines. To remedy this, you can either add a fixed height to the children or use the CSS rule white-space: nowrap.

☑️ 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.

<collapse-transition name="slide">
  <!-- ... -->
</collapse-transition>

☑️ Transition Duration

How long should the transition take in milliseconds.

Default: 300

<collapse-transition :duration="300">
  <!-- ... -->
</collapse-transition>

☑️ Transition Easing

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

Default: ease-in-out

<collapse-transition easing="ease-in-out">
  <!-- ... -->
</collapse-transition>

☕️ Credits

🔓 Security

If you discover any security related issues, please e-mail me instead of using the issue tracker.

📑 Changelog

See a list of important changes in the changelog.

📜 License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].