BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/beui/loader

Loader

beui/loader
FreeComponent

Loading indicator with seventeen variants: spinner, dots, bars, dot-matrix, dither, morph, comet, scramble, metaballs, newton, helix, percent, and five terminal-style ascii spinners. Scales from one size prop, uses currentColor, and reduced-motion swaps every transform for a calm opacity pulse.

Install it

npx shadcn@latest add https://beui.dev/r/loader.json

Source

components/motion/loader.tsxbeui.dev/r/loader.json · first 6 KB
1"use client";
2// beui.dev/components/motion/loader
3
4import { motion, useReducedMotion } from "motion/react";
5import { useEffect, useId, useState } from "react";
6import { EASE_IN_OUT } from "@/lib/ease";
7import { cn } from "@/lib/utils";
8
9export type LoaderVariant =
10 | "spinner"
11 | "dots"
12 | "bars"
13 | "dot-matrix"
14 | "dither"
15 | "ascii"
16 | "ascii-line"
17 | "ascii-braille"
18 | "ascii-blocks"
19 | "ascii-bounce"
20 | "morph"
21 | "comet"
22 | "scramble"
23 | "metaballs"
24 | "newton"
25 | "helix"
26 | "percent";
27
28// Terminal-style frame sets — the loaders CLI AI agents cycle through.
29const ASCII_SETS: Record<string, string[]> = {
30 ascii: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"],
31 "ascii-line": ["|", "/", "-", "\\"],
32 "ascii-braille": ["⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"],
33 "ascii-blocks": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█", "▇", "▆", "▅", "▄", "▃", "▂"],
34 "ascii-bounce": ["⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"],
35};
36
37export interface LoaderProps {
38 /** Which animation to render. */
39 variant?: LoaderVariant;
40 /** Base square size in px. Everything scales from this. */
41 size?: number;
42 /** Seconds per animation cycle. */
43 speed?: number;
44 /** Accessible label announced to screen readers. */
45 label?: string;
46 className?: string;
47}
48
49// Reduced motion keeps a calm opacity pulse and drops every transform.
50const REDUCED = {
51 animate: { opacity: [1, 0.4, 1] },
52 transition: { duration: 1.4, ease: EASE_IN_OUT, repeat: Infinity },
53};
54
55export function Loader({
56 variant = "spinner",
57 size = 32,
58 speed = 1,
59 label = "Loading",
60 className,
61}: LoaderProps) {
62 const reduce = useReducedMotion() ?? false;
63
64 return (
65 <span
66 role="status"
67 aria-label={label}
68 className={cn(
69 "inline-flex items-center justify-center text-foreground",
70 className,
71 )}
72 >
73 {variant === "spinner" && <Spinner size={size} speed={speed} reduce={reduce} />}
74 {variant === "dots" && <Dots size={size} speed={speed} reduce={reduce} />}
75 {variant === "bars" && <Bars size={size} speed={speed} reduce={reduce} />}
76 {variant === "dot-matrix" && (
77 <DotMatrix size={size} speed={speed} reduce={reduce} />
78 )}
79 {variant === "dither" && <Dither size={size} speed={speed} reduce={reduce} />}
80 {ASCII_SETS[variant] && (
81 <Ascii frames={ASCII_SETS[variant]} size={size} speed={speed} reduce={reduce} />
82 )}
83// … truncated

What it pulls in

npm packages

  • clsx
  • motion
  • tailwind-merge

Files it writes

  • components/motion/loader.tsx
  • lib/ease.ts
  • lib/utils.ts

Facts

Registry
beui
Type
registry:component
Access
Free
Files written
3
Licence
the repository states none
First indexed
2026-08-12
Last confirmed
today

Go to the source

beui.dev Raw registry item This item as JSON

More from beui

All 104 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Action Swap Bluraction-swap-blurbeuiComponentsFree3 deps · 4 files
Action Swap Cascadeaction-swap-cascadebeuiComponentsFree3 deps · 4 files
Action Swap Rollaction-swap-rollbeuiComponentsFree3 deps · 4 files
Agent Activityagent-activitybeuiComponentsFree4 deps · 9 files
Agent Loading States Agent Progressagent-progressbeuiComponentsFree3 deps · 3 files
AI Sidebarai-sidebarbeuiComponentsFree4 deps · 5 files
Animated Badgeanimated-badgebeuiComponentsFree4 deps · 3 files
Number Animation Animated Numberanimated-numberbeuiComponentsFree3 deps · 3 files
BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex