Skip to content

Foundations

Loader

Spinner and thinking indicators in a few sizes, with an accessible label.

2 variantsMIT

Preview

LoadingLoadingLoading
Loading historyUploading 3 files

Installation

Copies the component into components/ui and installs its dependencies and theme tokens.

pnpm dlx shadcn@latest add https://tuffui.com/r/loader.json

Usage

Pass your own data and wire the callbacks to your agent runtime.

import { Spinner, Thinking } from "@/components/ui/loader";

<Spinner label="Loading history" showLabel />
<Thinking words={["Thinking", "Searching", "Writing"]} />

Props

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"Spinner and Thinking size.
labelstring"Loading"Spinner: spoken label, also the visible text with showLabel.
showLabelbooleanfalseSpinner: show the label next to the ring.
wordsstring[][]Thinking: verbs to cycle through next to the dots. Each swaps in from below.
intervalnumber1800Thinking: ms per word.