Componentfeedback0.5 KB gzipZero dependencies
Save Indicator
Auto-save status chip: idle, saving, saved, error states.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add save-indicatorOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { SaveIndicator } from "@/components/ui/save-indicator"; <SaveIndicator />Source code
save-indicator.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxsave-indicator.tsx39 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface SaveIndicatorProps extends React.HTMLAttributes<HTMLSpanElement> { /** idle | saving | saved | error */ status?: "idle" | "saving" | "saved" | "error"; label?: string;} /** Autosave state indicator: smooth state transitions with checkmark. */export function SaveIndicator({ status = "idle", label, className, ...props }: SaveIndicatorProps) { const meta: Record<string, { text: string; tone: string; icon: React.ReactNode }> = { idle: { text: "Saved", tone: "text-muted-foreground", icon: <span className="size-1.5 rounded-full bg-border" /> }, saving: { text: "Saving…", tone: "text-muted-foreground", icon: <span className="size-2.5 rounded-full border-2 border-border border-t-accent animate-spin motion-reduce:animate-none" /> }, saved: { text: "✓ Saved", tone: "text-success", icon: <span className="size-1.5 rounded-full bg-success animate-pulse motion-reduce:animate-none" /> }, error: { text: "Save failed", tone: "text-destructive", icon: <span className="size-1.5 rounded-full bg-destructive animate-pulse motion-reduce:animate-none" /> },Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { SaveIndicator } from "@/components/ui/save-indicator"; <SaveIndicator />| Prop | Type | Description |
|---|---|---|
| status | "idle" | "saving" | "saved" | "error" | idle | saving | saved | error |
| label | string | Accessible label text rendered or attached to the control. |