Pending
Pending is a headless wrapper that adds pending-state accessibility attributes, data attributes, and interaction prevention to its slotted child. It uses Radix UI’s Slot, so it renders no additional DOM element or built-in visual indicator.


shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @diceui in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { Pending } from "@/components/pending";export function SaveButton() { return ( <Pending isPending> <button type="button">Save</button> </Pending> );}- Use for buttons or other interactive elements that must prevent activation while an asynchronous operation is in progress.
- Use when the pending state should expose aria-busy="true" and aria-disabled="true" without changing the rendered element.
- Use when you want styling hooks through data-pending or data-disabled attributes.
- Use with a single slotted child, such as a native button or another compatible component.
Examples
Pending submit button
Prevents pointer and keyboard activation while a save request is running.
import { Pending } from "@/components/pending";export function SubmitButton({ isSaving }: { isSaving: boolean }) { return ( <Pending isPending={isSaving}> <button type="submit">{isSaving ? "Saving…" : "Save changes"}</button> </Pending> );}Disabled slotted control
Adds the data-disabled state hook without enabling pending interaction prevention.
import { Pending } from "@/components/pending";export function ContinueButton({ unavailable }: { unavailable: boolean }) { return ( <Pending disabled={unavailable}> <button type="button" disabled={unavailable}> Continue </button> </Pending> );}Custom pending identifier
Provides a stable custom id to the slotted element while applying pending state semantics.
import { Pending } from "@/components/pending";export function UploadAction({ uploading }: { uploading: boolean }) { return ( <Pending id="upload-action" isPending={uploading}> <button type="button">Upload file</button> </Pending> );}API reference
Accessibility
- When isPending is true, the slotted element receives aria-busy="true" and aria-disabled="true".
- While pending, click, pointer, mouse, Enter, and Space keyboard events are prevented with event.preventDefault().
- The component does not automatically render a loading label, spinner, focus treatment, or visual state; provide those through the slotted child and CSS.
- disabled only adds data-disabled. If the underlying control should be natively disabled, pass disabled to that child as well.
- Use a meaningful child label and preserve an accessible name while changing its pending presentation.
Docs written by openai:gpt-5.6-luna from the registry source.
Use with Coding Agent
Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.
Use the "Pending" component (diceui-radix/pending) from its shadcn registry.1. Install it with: npx shadcn@latest add @diceui/pending2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: isPending, disabled, id, children.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { Pending } from "@/components/pending";export function SaveButton() { return ( <Pending isPending> <button type="button">Save</button> </Pending> );}```Files & dependencies
- components/pending.tsx