Componentfeedback0.63 KB gzipZero dependencies
Sync Status
Sync status chip with spinning icon and last-sync timestamp.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add sync-statusOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { SyncStatus } from "@/components/ui/sync-status"; <SyncStatus />Source code
sync-status.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxsync-status.tsx44 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface SyncStatusProps extends React.HTMLAttributes<HTMLSpanElement> { /** idle | syncing | synced | error */ status?: "idle" | "syncing" | "synced" | "error"; lastSync?: string;} /** Sync status badge: spinning sync icon + last synced timestamp. */export function SyncStatus({ status = "idle", lastSync, className, ...props }: SyncStatusProps) { const meta = { idle: { text: "Ready", icon: "text-muted-foreground", spin: false }, syncing: { text: "Syncing…", icon: "text-accent", spin: true }, synced: { text: "Synced", icon: "text-success", spin: false }, error: { text: "Sync error", icon: "text-destructive", spin: false },Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { SyncStatus } from "@/components/ui/sync-status"; <SyncStatus />| Prop | Type | Description |
|---|---|---|
| status | "idle" | "syncing" | "synced" | "error" | idle | syncing | synced | error |
| lastSync | string | Configures last sync. |