A Vue component for dynamic CSS height transitions from any value to auto and vice versa, perfect for accordions.
Vue Collapsed is a Vue component library that enables smooth CSS height transitions between fixed heights and `auto` values. It solves the common problem of animating height to accommodate dynamic content, such as in accordions or expandable panels, using a declarative Vue API. The component handles transition timing, accessibility, and reduced motion preferences automatically.
Vue developers building interactive UIs with collapsible sections, such as accordions, expandable cards, or togglable content areas. It's particularly useful for those needing reliable height animations without manual CSS workarounds.
Developers choose Vue Collapsed because it provides a zero-dependency, lightweight solution specifically for Vue that handles the tricky `height: auto` transition seamlessly. Its automatic duration calculation and built-in accessibility features reduce boilerplate while offering fine-grained control via custom transitions and lifecycle events.
Dynamic CSS height transition from any value to auto and vice versa for Vue. Accordion ready.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The library has no dependencies and a minimal bundle size, as shown by the npm badges indicating 0 dependencies and a small bundle footprint, reducing bloat in Vue projects.
Dynamically calculates transition duration via the --vc-auto-duration CSS variable based on element height, ensuring smooth animations without manual tuning for different content sizes.
Respects user prefers-reduced-motion settings by disabling transitions automatically and provides patterns for adding ARIA attributes, making it easy to implement accessible collapsible sections.
Supports custom durations, easings, and multi-property transitions through CSS classes and data-collapse attribute states, as demonstrated in the README examples for advanced use cases.
Requires developers to write all CSS for transitions and styling from scratch, which can be time-consuming for teams looking for quick, out-of-the-box solutions.
Primarily focused on height transitions; for animations involving other properties like opacity or transforms, additional CSS work is needed, and it might not handle complex animation scenarios seamlessly.
Designed exclusively for Vue, so it's not portable to other frameworks, which could be a limitation in multi-framework environments or for developers switching stacks.