BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/nexvyn/action-button

Action Button

nexvyn/action-button
FreeComponent

An async-aware button with an idle → pending → success/error state machine, promise tracking, abort support, and live screen-reader announcements.

Live preview

live · rendered by the registry
Rendered by nexvyn on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://ui.nexvyn.dev/r/action-button.json

Source

components/ui/action-button.tsxui.nexvyn.dev/r/action-button.json · first 6 KB
1'use client'
2
3import * as React from 'react'
4import { useReducedMotion } from 'motion/react'
5import { cn } from '@/lib/utils'
6import { Button, type ButtonProps } from '@/components/ui/button'
7
8export type ActionButtonState = 'idle' | 'pending' | 'success' | 'error'
9
10export interface ActionButtonProps extends Omit<
11 ButtonProps,
12 'loading' | 'loadingLabel' | 'loadingIndicator' | 'onClick'
13> {
14 /**
15 * Controlled state. If provided, the component becomes fully controlled
16 * and ignores the result of `onAction`.
17 */
18 state?: ActionButtonState
19 /**
20 * Default state for uncontrolled mode.
21 */
22 defaultState?: ActionButtonState
23 /**
24 * A callback that returns a promise. The component tracks the promise lifecycle
25 * (idle → pending → success/error → idle). Receives an AbortSignal.
26 */
27 onAction?: (signal: AbortSignal) => Promise<void>
28 /**
29 * Callback fired whenever internal state changes (uncontrolled mode).
30 */
31 onStateChange?: (state: ActionButtonState) => void
32 /**
33 * Minimum time (ms) to show the pending state. Prevents flicker for fast operations.
34 * Defaults to 0 (no minimum). Opt-in only.
35 */
36 minPendingMs?: number
37 /**
38 * Time (ms) before resetting from success/error back to idle.
39 * Defaults to 2000ms. Set to 0 to disable auto-reset.
40 */
41 resetDelayMs?: number
42 /** Label content shown in idle state. */
43 idleLabel?: React.ReactNode
44 /** Label content shown in pending state. */
45 pendingLabel?: React.ReactNode
46 /** Label content shown in success state. */
47 successLabel?: React.ReactNode
48 /** Label content shown in error state. */
49 errorLabel?: React.ReactNode
50 /** Icon shown in idle state. */
51 idleIcon?: React.ReactNode
52 /** Icon shown in pending state. Defaults to a spinner. */
53 pendingIcon?: React.ReactNode
54 /** Icon shown in success state. Defaults to a checkmark. */
55 successIcon?: React.ReactNode
56 /** Icon shown in error state. Defaults to an × glyph. */
57 errorIcon?: React.ReactNode
58 /**
59 * Full control over rendering each state. Overrides individual label/icon props.
60 * The returned node is rendered inside the button.
61 */
62 renderState?: (state: ActionButtonState) => React.ReactNode
63 /**
64 * Accessible live-region announcement per state.
65 * Provide either a static string or a function.
66 */
67 announcements?: Partial<Record<ActionButtonState, string>>
68 /** onClick passthrough — fires only in idle state. Does not track async. */
69// … truncated

What it pulls in

npm packages

  • motion
  • @radix-ui/react-slot
  • class-variance-authority

Files it writes

  • components/ui/action-button.tsx
  • components/ui/button.tsx
  • lib/motion-tokens.ts
  • lib/sound.ts

Facts

Registry
nexvyn
Type
registry:ui
Access
Free
Files written
4
Licence
MIT
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

Docs on nexvyn ui.nexvyn.dev Nexvyn/Nexvyn-ui on GitHub Raw registry item This item as JSON

More from nexvyn

All 40 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionnexvynComponentsFree1 dep
Adaptive Actionsadaptive-actionsnexvynComponentsFree1 dep
AI Inputai-inputnexvynComponentsFree1 dep · 2 files
BadgebadgenexvynComponentsFree2 deps · 2 files
Bars Themebars-themenexvynComponentsFree1 dep · 3 files
Bounce Sidebarbounce-sidebarnexvynComponentsFree1 dep · 2 files
BreadcrumbsbreadcrumbsnexvynComponentsFree1 dep · 2 files
ButtonbuttonnexvynComponentsFree3 deps · 3 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex