Vue Smooth Reflow (VSR) is a Vue 2 mixin designed to provide smooth CSS transitions for elements undergoing reflow, specifically targeting changes in `height: auto`, `width: auto`, and element repositioning via `transform` (specifically `translate()`). It allows developers to register specific CSS properties to transition smoothly when a component's data changes, without conflicting with Vue's built-in `<transition>` components. The current stable version is 0.1.12. The project has not seen active development since late 2020, making it primarily suitable for existing Vue 2 applications and not actively maintained for Vue 3 or newer ecosystems. Its key differentiator is the direct handling of reflow transitions for dynamic content sizes and positions, rather than managing entrance/exit transitions like Vue's native solution.
npm install vue-smooth-reflowVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `vue-smooth-reflow` to smoothly transition the height and width of a container element when its internal content changes, triggered by a button click. It highlights the mixin's integration and `this.$smoothReflow()` API call with custom properties.
For Vue 3, consider using built-in transition capabilities (e.g., `<Transition>`) or modern CSS techniques like `grid-template-rows` transitions, or a dedicated Vue 3 compatible library for similar effects.
Define transitions for other properties via CSS classes or `<style>` blocks, ensuring they are not applied directly as inline `style` attributes on the targeted element.
Ensure your reflow requirements are limited to these specific properties. For other properties, combine VSR with standard CSS transitions or Vue's `<transition>` components on separate elements.
For new projects or existing projects considering upgrading Vue, it's highly recommended to seek alternative, actively maintained solutions that support Vue 3+.
Ensure that `import smoothReflow from 'vue-smooth-reflow'` is present and that `mixins: [smoothReflow]` is added to your component's options.
Call `$smoothReflow()` within the `mounted()` lifecycle hook of your Vue component, or after ensuring the mixin is properly initialized.
Verify that `this.$smoothReflow()` is called, the `property` option correctly lists 'height' and/or 'width', and the target element (or its parent) has `overflow: hidden` in its CSS.
This library is Vue 2 only. For Vue 3, consider native CSS transitions, `grid-template-rows` animation, or a Vue 3 compatible alternative.