About
A utility component and hook that applies pending/loading state to any interactive element, blocking clicks and keyboard activation with proper ARIA attributes.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Pending to your project and fits it to your theme.
Code
How Pending is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import { Pending } from "@/components/ui/pending";
import * as React from "react";
export default function PendingLinkDemo() {
const [isPending, setIsPending] = React.useState(false);
const onNavigate = React.useCallback(
(event: React.MouseEvent<HTMLAnchorElement>) => {
event.preventDefault();
setIsPending(true);
// Simulate async navigation
setTimeout(() => {
setIsPending(false);
}, 2000);
},
[],
);
return (
<div className="flex items-center justify-center">
<Pending isPending={isPending}>
<a
href="/docs/components/pending"
onClick={onNavigate}
className="text-primary underline-offset-4 hover:underline"
>
{isPending ? "Loading dashboard..." : "Go to Dashboard"}
</a>
</Pending>
</div>
);
}








