Rendyn

Component library

189 components

Interaction

Animated Badge

Animated Badge changes its appearance and optional icon according to a supplied status.

Interactive exampleReact Tailwind CSS

Practical React example

Summarize the state of a background task beside its name.

Before you copy and paste

Keep the example in the React rendering environment required by the imported component. Copy components/motion/animated-badge.tsx and its returned support files from the Code tab; preserve the project-relative paths.

Listed package dependencies: clsx, lucide-react, motion, react, tailwind-merge.

Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.

Summarize the state of a background task beside its name

// Usage adapted from beUI's pinned MIT source.
// Copyright (c) 2026 Saurabh Chauhan. See ./LICENSES.md.
"use client";

import { useEffect, useState } from "react";
import { AnimatedBadge, type AnimatedBadgeStatus } from "@/components/motion/animated-badge";

const STATES: Array<{ status: AnimatedBadgeStatus; label: string }> = [
  { status: "loading", label: "Syncing" },
  { status: "success", label: "Synced" },
  { status: "warning", label: "Review" },
  { status: "danger", label: "Failed" },
];

export function AnimatedBadgePreview() {
  const [active, setActive] = useState(0);
  const state = STATES[active];

  useEffect(() => {
    const id = window.setInterval(() => {
      setActive((current) => (current + 1) % STATES.length);
    }, 1600);

    return () => window.clearInterval(id);
  }, []);

  return (
    <div className="flex flex-col items-center gap-6">
      <div className="flex h-16 items-center justify-center">
        <AnimatedBadge status={state.status} size="md" aria-live="polite">
          {state.label}
        </AnimatedBadge>
      </div>

      <div className="grid grid-cols-2 gap-2 sm:grid-cols-3">
        <AnimatedBadge status="neutral" size="sm">Queued</AnimatedBadge>
        <AnimatedBadge status="info" size="sm">Live</AnimatedBadge>
        <AnimatedBadge status="loading" size="sm">Indexing</AnimatedBadge>
        <AnimatedBadge status="success" size="sm">Verified</AnimatedBadge>
        <AnimatedBadge status="warning" size="sm">Pending</AnimatedBadge>
        <AnimatedBadge status="danger" size="sm">Blocked</AnimatedBadge>
      </div>
    </div>
  );
}

Usage example adapted from beUI's pinned MIT source. Retain the source licence notices when copying.

Drive status from the task state and use readable text such as Waiting or Failed. Use contentKey when the label’s identity changes and should animate.

Customization

AnimatedBadgeProps.status
Optional; AnimatedBadgeStatus.
AnimatedBadgeProps.size
Optional; AnimatedBadgeSize.
AnimatedBadgeProps.children
Optional; ReactNode.
AnimatedBadgeProps.icon
Optional; ReactNode.
AnimatedBadgeProps.showIcon
Optional; boolean.
AnimatedBadgeProps.pulse
Optional; boolean.
AnimatedBadgeProps.contentKey
Optional; string | number.

Integration notes

  • Status color and pulse cannot be the only indicators of failure or progress.
  • Do not show success merely because an animation finished; wait for the underlying operation.

Component source: beUI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.

Better with your agent

Give your agent taste.

The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.

All components are free. Sign up only to connect MCP.

Connect to MCP