Shimmer effect in Card when you load Supabase dashboard.
When loading a dashboard, especially one as feature-rich as Supabase’s, it’s essential to provide visual feedback to users indicating that content is being loaded. A popular and visually appealing way to achieve this is by using a shimmer effect. This effect simulates a loading state and keeps users engaged while the actual content is being fetched.
Let’s explore how Supabase implements a shimmer effect in their dashboard using the animate property and some creative CSS.
The ShimmeringCard component in Supabase's source code showcases how to create a shimmering loading effect using a combination of React and CSS animations.
Here’s the implementation of the ShimmeringCard component:
In this component, CardButton is used to create the card structure, and the shimmer effect is applied to the text elements within the card using the shimmering-loader class.
Animation Definition: The shimmer keyframes animation moves the background gradient from left to right.
Gradient Background: The background is a linear gradient that creates the shimmer effect. The colors transition smoothly to give the appearance of a light moving across the surface.
Animation Application: The shimmering-loader class applies this animation to any element, making it shimmer.
Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.