DocumentationJelly Loader

Jelly Loader

A beautiful loading animation with stacked, rotating elliptical shapes that create a mesmerizing jelly-like effect. Uses a gradient color palette from light pink to deep magenta.

Install using CLI

npx shadcn@latest add "https://obsidianui.dev/r/jelly-loader.json"

Install Manually

1

Install dependencies

npm install framer-motion
2

Copy the source code

Copy into components/ui/jelly-loader.tsx

'use client';
 
import React from 'react';
import { motion, Transition } from 'framer-motion';
 
type JellyLoaderProps = {
    numberOfCubes?: number;
    colors?: string[];
};
 
export function JellyLoader({
    numberOfCubes = 8,
    colors = ['#FFE4E1', '#FFB6C1', '#FF8A95', '#FF6B8A', '#E91E63', '#C2185B', '#AD1457', '#880E4F']
}: JellyLoaderProps) {
    const transition: Transition = {
        duration: 1.5,
        repeat: Infinity,
        repeatDelay: 0.5,
        ease: 'easeOut'
    };
 
    return (
        <div className="-translate-x-1/5 flex items-center justify-center">
            {Array.from({ length: numberOfCubes }).map((_, index) => {
                const x = index * 10;
                const y = -index * 10;
 
                return (
                    <motion.span
                        key={index}
                        className="h-[70px] w-[100px] absolute rounded-full"
                        style={{
                            x,
                            y,
                            zIndex: numberOfCubes - index,
                            backgroundColor: colors[index % colors.length],
                            opacity: 1 - index * 0.05
                        }}
                        initial={{ scale: 1 }}
                        animate={{ scale: [1, 0.75, 1], rotate: [0, 360] }}
                        transition={{
                            ...transition,
                            delay: index * 0.05
                        }}
                    />
                );
            })}
        </div>
    );
}
 
export default JellyLoader;

Props

Prop NameTypeDefaultDescription
numberOfCubesnumber8Number of stacked ellipses
colorsstring[][...pinkGradient]Array of colors for each layer

Examples

Custom Colors

<JellyLoader 
  numberOfCubes={6}
  colors={['#3B82F6', '#60A5FA', '#93C5FD', '#BFDBFE', '#DBEAFE', '#EFF6FF']}
/>

Fewer Layers

<JellyLoader numberOfCubes={4} />