Apple Hello Loader
Free Loaders React component — AppleHelloLoader. MIT licensed, copy-paste ready for Next.js and Tailwind CSS.
Apple-style greeting loader that cycles through hello, bonjour, hola, and more with a soft fade. Pass greetings, intervalMs, and fadeMs to tune the loop.
Preview
hello
Setup
How to use
Free for personal and commercial use. No UI attribution required. Include the MIT copyright notice when copying component source into your project. Read the MIT license.
- 1
Run in your terminal:
$npm install clsx tailwind-merge lucide-react - 2
Copy
lib/cn.tsbelow. Skip if you already havecn(). - 3
Copy the code below and create
components/loaders/apple-hello-loader.tsxin your project. - 4
Import and render:
Exampleimport { AppleHelloLoader } from "@/components/loaders/apple-hello-loader";
lib/cn.ts
import { type ClassValue, clsx } from "clsx";import { twMerge } from "tailwind-merge";export function cn(...inputs: ClassValue[]) {return twMerge(clsx(inputs));}
components/loaders/apple-hello-loader.tsx
"use client";import { useEffect, useState } from "react";import { cn } from "@/lib/cn";const DEFAULT_GREETINGS = ["hello","bonjour","hola","ciao","olá","namaste",] as const;export type AppleHelloLoaderProps = Readonly<{greetings?: readonly string[];intervalMs?: number;fadeMs?: number;fill?: boolean;className?: string;}>;function usePrefersReducedMotion() {const [reduced, setReduced] = useState(false);useEffect(() => {const media = window.matchMedia("(prefers-reduced-motion: reduce)");const update = () => setReduced(media.matches);update();media.addEventListener("change", update);return () => media.removeEventListener("change", update);}, []);return reduced;}export function AppleHelloLoader({greetings = DEFAULT_GREETINGS,intervalMs = 2600,fadeMs = 400,fill = false,className,}: AppleHelloLoaderProps) {const reducedMotion = usePrefersReducedMotion();const [index, setIndex] = useState(0);const [visible, setVisible] = useState(true);const items = greetings.length > 0 ? greetings : DEFAULT_GREETINGS;useEffect(() => {if (reducedMotion || items.length <= 1) return;const interval = globalThis.setInterval(() => {setVisible(false);globalThis.setTimeout(() => {setIndex((current) => (current + 1) % items.length);setVisible(true);}, fadeMs);}, intervalMs);return () => globalThis.clearInterval(interval);}, [fadeMs, intervalMs, items.length, reducedMotion]);return (<divdata-slot="apple-hello-loader"className={cn("flex items-center justify-center bg-black",fill ? "absolute inset-0" : "min-h-24 min-w-40 rounded-2xl px-6 py-8",className,)}role="status"aria-live="polite"aria-label={items[index]}><pclassName={cn("px-4 text-center font-sans text-lg font-extralight tracking-tight text-white capitalize transition-all duration-500 motion-reduce:transition-none",visible ? "translate-y-0 opacity-100" : "translate-y-1 opacity-0",)}>{items[index]}</p></div>);}