Baktiyar Ablaikhan

Loader

Source
Aceternity UI ↗
Author
Aceternity UI
Licence
Aceternity UI licence (free component)

Loading…

Five looping loaders: bouncing dots, a rolling trio, a filling bolt, glitch text and wave text.

Code

"use client";
import React from "react";
import {
  LoaderFive,
  LoaderFour,
  LoaderOne,
  LoaderThree,
  LoaderTwo,
} from "@/lab/aceternity/ui/loader";

const cells: { name: string; node: React.ReactNode }[] = [
  { name: "LoaderOne", node: <LoaderOne /> },
  { name: "LoaderTwo", node: <LoaderTwo /> },
  {
    name: "LoaderThree",
    node: (
      <div className="origin-center scale-[0.6]">
        <LoaderThree />
      </div>
    ),
  },
  { name: "LoaderFour", node: <LoaderFour text="Loading..." /> },
  { name: "LoaderFive", node: <LoaderFive text="Generating chunks..." /> },
];

export default function LoaderDemo() {
  return (
    <div className="relative flex h-full w-full items-center justify-center p-[4%]">
      <div className="grid h-full w-full grid-cols-3 grid-rows-2 gap-2">
        {cells.map((cell, i) => (
          <div
            key={cell.name}
            className={
              "relative flex items-center justify-center overflow-hidden rounded-xl border border-neutral-200 bg-white/60 text-sm dark:border-neutral-800 dark:bg-neutral-900/60" +
              (i === 4 ? " col-span-2" : "")
            }
          >
            {cell.node}
            <span className="absolute bottom-1.5 left-2 font-mono text-[10px] text-neutral-400">
              {cell.name}
            </span>
          </div>
        ))}
      </div>
    </div>
  );
}
Prompt

Build "Loader", a loader animation. What it does: Five looping loaders: bouncing dots, a rolling trio, a filling bolt, glitch text and wave text. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS, using motion. Technique: the Motion library. It sits on a light background, in a 16:10 frame. Respect prefers-reduced-motion with a still state, pause work when the element is off screen, and keep it accessible. Original: https://ui.aceternity.com/components/loader (Aceternity UI, Aceternity UI licence (free component)).