nextui.dev
Home
Docs
Saved
Pricing
Components37
  • Forms & inputs7
  • Cards13
  • Buttons, badges & avatars8
  • Feedback & display6
  • Effects3
Agents27
  • Chat inputNew
  • Task checklistNew
  • ReasoningNew
  • Tool callNew
  • Terminal OutputNew
  • Model pickerNew
  • Tool approvalNew
  • Error & RetryNew
  • AttachmentsNew
  • SourcesNew
  • Agent timelineNew
  • Context meterNew
  • Artifact panelNew
  • Message actionsNew
  • Streaming messageNew
  • Sub-agentsNew
  • Diff ViewerNew
  • Conversation shellNew
  • Agent questionNew
  • Plan ReviewNew
  • Voice agentNew
  • Voice orbNew
  • Thinking ring
  • Thinking waveNew
  • Thinking sparkle
  • Thinking bot
  • Prompt deckNew
Blocks20
  • Agent chatNew
  • Pill heroNew
  • Grid hero
  • Moodboard generatorNew
  • Waitlist heroNew
  • Intro bannerNew
  • Creative home heroNew
  • Chat heroNew
  • App shelfNew
  • Usage card
  • Design resultsNew
  • Pricing tiers
  • Dashboard home
  • The shiftNew
  • Launch perksNew
  • Testimonials
  • Quote
  • Team
  • Leads tableNew
  • Sign in
Pages13
  • ASCII workspace$49
  • Research agent$49
  • Support agent$49
  • Coding agent$49
  • CRM overviewNew
  • Marketing dashboardNew
  • Developer portfolio$49
  • Particle landing$49
  • Particle story$49
  • Statement converter$49
  • AI photo studio$49
  • Group card launch$49
  • Month-end storyNew
Themes9
  • Default
  • Ember
  • Ocean
  • Forest
  • Grape
  • Rose
  • Amber
  • Clay
  • Brutal
Upgrade
nextui.dev

nextui components, blocks and themes you install with one command.

Product

  • Components
  • Blocks
  • Themes
  • Pricing

Resources

  • Docs
  • Roadmap
  • GitHub

Legal

  • License
  • Privacy
  • Terms
  • Refunds

nextUI

[ 200 OK ] · nextUI

© 2026 NEXTUI • All rights reserved.

Upgrade
ComponentsAI & agentsError & Retry
Copy promptCopy prompt

Customize

Picks the icon and default title

One line on what happened and what happens next

waiting counts down, retrying shows a spinner, failed has no automatic retries left, resolved shows a short success line

Seconds before onRetry is called on its own. 0 turns the countdown off. People can cancel it

8

Loop a rate limit that succeeds on the second retry, for demos

JSX · copied with Copy prompt

<ErrorRetry autoPlay />

Error & RetryNew

An agent error people can act on: what failed, a countdown to the next automatic retry, Retry now and the raw details.

Installation

Set your access key from API keys as NEXTUI_TOKEN in .env.local and add the @nextui namespace below to components.json once. Then every item installs by name. Each install counts as a copy on a free account.

$pnpm dlx shadcn@latest add @nextui/error-retry
1{
2 "registries": {
3 "@nextui": {
4 "url": "https://nextui.dev/r/{name}.json",
5 "headers": { "Authorization": "Bearer ${NEXTUI_TOKEN}" }
6 }
7 }
8}

Usage

1"use client";
2
3import { useState } from "react";
4import { useChat } from "@ai-sdk/react";
5import { ErrorRetry } from "@/components/nextui/error-retry";
6
7export function ChatError() {
8 const { error, regenerate, clearError, status } = useChat();
9 const [attempt, setAttempt] = useState(1);
10 if (!error && status !== "submitted") return null;
11
12 const rateLimited = /429|rate/i.test(error?.message ?? "");
13 return (
14 <ErrorRetry
15 kind={rateLimited ? "rate_limit" : "unknown"}
16 code={rateLimited ? "429" : undefined}
17 details={error?.message}
18 status={status === "submitted" ? "retrying" : attempt > 3 ? "failed" : "waiting"}
19 retryIn={rateLimited ? 10 : 3}
20 attempt={attempt}
21 maxAttempts={3}
22 onRetry={() => {
23 setAttempt((a) => a + 1);
24 regenerate();
25 }}
26 onDismiss={clearError}
27 />
28 );
29}

API reference

Edit props live in the preview above, or see all 13 props
PropTypeDefaultDescription
kind"rate_limit" | "overloaded" | "network" | "tool" | "unknown""rate_limit"Picks the icon and default title
titlestring–Headline. Defaults to a plain name for the kind
messagestring–One line on what happened and what happens next
codestring"429"Short code shown as a chip
detailsstring–Raw error text, shown under a Details toggle
status"waiting" | "retrying" | "failed" | "resolved""waiting"waiting counts down, retrying shows a spinner, failed has no automatic retries left, resolved shows a short success line
retryInnumber8Seconds before onRetry is called on its own. 0 turns the countdown off. People can cancel it
attemptnumber1Which retry is next, shown as attempt N of maxAttempts. The countdown restarts when it changes
maxAttemptsnumber3Shown next to the attempt number
onRetry() => void–Called by Retry now and when the countdown reaches zero
onDismiss() => void–Called by the close button. Leave out to hide it
autoPlaybooleanfalseLoop a rate limit that succeeds on the second retry, for demos
classNamestring–Extra classes on the wrapper

Related

All components

Chat inputNew

Task checklistNew

Free

ReasoningNew

Sign in to see the code

Preview it freely. A free account copies code and prompts a few times a day.

Sign in