Retro Loader

Special

Retro loading screens with cassette tape, floppy disk, and CRT boot animations.

Import

import { PixelLoader } from "@/components/ui/pixel/pixel-loader"

Usage

Cassette

LOADING
LOADING 0%

Floppy

SYSTEM DISK
READING 0%

CRT

BOOTING [0%]

Component Source

Copy and paste the following code into your project at /src/components/ui/pixel/pixel-loader.tsx

"use client";

import { cva, type VariantProps } from "class-variance-authority";
import * as React from "react";
import { cn } from "@/lib/utils";

const pixelLoaderVariants = cva(
  "relative flex flex-col items-center justify-center p-8 border-4 border-black bg-white dark:bg-[#1a1a1a] shadow-[8px_8px_0px_0px_rgba(0,0,0,1)]",
  {
    variants: {
      variant: {
        cassette: "min-h-[300px]",
        floppy: "min-h-[300px]",
        crt: "min-h-[400px] bg-black text-[#00ff00]",
      },
      size: {
        sm: "w-[250px]",
        md: "w-[350px]",
        lg: "w-[450px]",
        full: "w-full",
      },
    },
    defaultVariants: {
      variant: "cassette",
      size: "md",
    },
  },
);

export interface PixelLoaderProps
  extends React.HTMLAttributes<HTMLDivElement>,
    VariantProps<typeof pixelLoaderVariants> {
  progress?: number;
  text?: string;
  isLoading?: boolean;
}

const PixelLoader = React.forwardRef<HTMLDivElement, PixelLoaderProps>(
  (
    {
      className,
      variant,
      size,
      progress = 0,
      text,
      isLoading = true,
      children,
      ...props
    },
    ref,

// ... (more code below)

Props

PropTypeDefaultDescription
variant"cassette" | "floppy" | "crt""cassette"Loading animation style
size"sm" | "md" | "lg" | "full""md"Loader size
progressnumber0Progress percentage (0-100)
textstring-Custom loading text
isLoadingbooleantrueEnable auto-progress animation

Examples

Cassette Tape

Classic cassette tape loading animation

Cassette

LOADING
LOADING 0%

Floppy

SYSTEM DISK
READING 0%

CRT

BOOTING [0%]

Floppy Disk

Floppy disk inserting animation

Cassette

LOADING
LOADING 0%

Floppy

SYSTEM DISK
READING 0%

CRT

BOOTING [0%]

CRT Boot

CRT terminal boot sequence

Cassette

LOADING
LOADING 0%

Floppy

SYSTEM DISK
READING 0%

CRT

BOOTING [0%]

Accessibility

This component is built with accessibility in mind, including proper ARIA attributes, keyboard navigation, and focus management.