What a Second Click Should Do While a Dialog Is Closing

A CoreUI Drawer with filters, half faded and sliding out to the right on a purple gradient, while a mouse pointer clicks its Filters button again

A user opens a filters panel, changes their mind and clicks the Filters button to close it. The panel starts to slide out, and halfway through they realise they wanted one more filter after all, so they click the button again.

What should happen? The panel is still on screen, still in the DOM, still open as far as the browser is concerned. It is just on its way out. Many dialog implementations drop that second click, so the panel finishes closing and the user has to wait and click a third time. This guide shows how to reopen a dialog during its closing animation instead, and the details that make that harder than it looks.

Read More…

How to use requestAnimationFrame in JavaScript

Creating smooth animations in JavaScript requires synchronizing with the browser’s refresh rate for optimal performance. As the creator of CoreUI, I’ve built countless animated UI components and interactive visualizations using proper animation techniques. The standard approach uses requestAnimationFrame() which schedules animation updates to match the display refresh rate, typically 60 frames per second. This provides smoother animations than setInterval or setTimeout while being more battery-efficient.

Read More…

How to create reusable transitions in Vue

Duplicating animation code across multiple components leads to inconsistent user experiences and harder maintenance when you need to update animation timings or effects. As the creator of CoreUI, I’ve built reusable animation systems for numerous production applications. Vue allows you to create reusable transition components by wrapping the built-in Transition component and defining preset CSS classes. This approach centralizes your animation logic and ensures consistent motion design throughout your application.

Read More…

How to use transition-group in Vue

Animating lists when items are added, removed, or reordered creates a much better user experience than instant changes, especially in task lists or data tables. As the creator of CoreUI, I’ve built numerous animated list interfaces for enterprise applications. Vue 3 provides the TransitionGroup component specifically for animating multiple elements or lists with v-for loops. Unlike the Transition component which handles single elements, TransitionGroup manages transitions for each item independently.

Read More…

How to use transitions in Vue

Adding smooth transitions when elements appear or disappear greatly enhances user experience and makes interfaces feel polished and professional. As the creator of CoreUI, I’ve implemented countless animations in production applications. Vue 3 provides a built-in Transition component that automatically applies CSS classes during enter and leave phases, making animations straightforward. This approach requires no external libraries and works with standard CSS transitions or animations.

Read More…

How to use Framer Motion in React

Framer Motion is the most powerful animation library for React, providing declarative animations, gestures, and complex transitions with minimal code. As the creator of CoreUI, I’ve used Framer Motion extensively for creating sophisticated UI animations. The most effective approach is using the motion components with simple props to define animations declaratively. This provides smooth, performant animations with built-in gesture support and layout animations.

Read More…

How to use react-transition-group for animations

React Transition Group provides powerful components for managing component lifecycle during animations and transitions. As the creator of CoreUI, I rely on this library for complex animation sequences. The most effective approach is using CSSTransition component which automatically applies CSS classes at different animation phases. This ensures smooth enter/exit animations with proper timing and cleanup.

Read More…

How to animate components in React

Creating smooth animations in React components enhances user experience and provides visual feedback for state changes. As the creator of CoreUI, I’ve implemented countless animations in production applications. The most efficient approach is to use CSS transitions combined with React’s state management to trigger animation classes. This method provides excellent performance and is compatible across all browsers.

Read More…
Subscribe to our newsletter
Get early information about new products, product updates and blog posts.