GitHub

Infinity Track

A tracked infinity loader made from monospace unicode cells and staggered block masks.

InfinityTrack combines a static unicode infinity track with staggered moving block masks. It is the tracked counterpart to InfinitySquareSnake.

Loading
import { InfinityTrack } from "@/components/loading-ui/infinity-track";

export function InfinityTrackDemo() {

Credits to shaah1d for creating the initial animation.

Installation

pnpm dlx shadcn@latest add @loading-ui/infinity-track

Usage

import { InfinityTrack } from "@/components/loading-ui/infinity-track";
<InfinityTrack />

Customization

Use blocks and track for unicode glyphs. The path scales with text size, and --duration, --delay, and --mask-color control motion and surface matching.

Size

Scale the tracked infinity path with text-size utilities.

LoadingLoadingLoading
import { InfinityTrack } from "@/components/loading-ui/infinity-track";

export function InfinityTrackSize() {

Color

The track and moving glyphs inherit text color.

LoadingLoadingLoading
import { InfinityTrack } from "@/components/loading-ui/infinity-track";

export function InfinityTrackColor() {

Duration

Set --duration to tune the infinity loop.

LoadingLoadingLoading
import { InfinityTrack } from "@/components/loading-ui/infinity-track";

export function InfinityTrackDuration() {

Glyphs

Swap glyphs and set --mask-color when the loader sits on a tinted surface.

LoadingLoading
Loading
import { InfinityTrack } from "@/components/loading-ui/infinity-track";

export function InfinityTrackGlyphs() {