Skip to content
SkillCodex
Menu

Spinner

Spinner

A compact animated indicator for work whose completion amount is unknown, paired with a meaningful busy status.

Try the component
Context, sources and actions
Sources and revision
Updated
Version
v1.0.26 · r2
Sources
5 sources
Status
Published
Read the sources

You may have searched for: a spinning mark while something loadsshow that the button is still workingan unknown wait with no percentage

All phrasings
Save and share

Recognize

Wait and track progress

Try it

Is duration unknown, measurable, or should the content shape be preserved?

Spinner

Shared trial context

A workspace waits for content or an operation to finish and communicates only the progress it can measure honestly.

Spinner

Mission

Spinner

Start saving, verify duplicate activation is blocked, read the busy status, and wait for the final status.

The document is ready to save.

Live result

The document is ready to save.

Step 1 of 3

Try

Try the component. Your live result appears just above. Move on at your own pace.

Behavior and edge case
What to observe
The button exposes Saving, prevents a duplicate request, and shows a redundant animated indicator.
Edge case
After a long threshold, the interface adds explanatory text and a cancel or retry path instead of spinning forever.

What this example shows

Spinner communicates an indeterminate wait; Progress bar shows measurable completion, while Skeleton previews the shape of content still loading.

Which fits your need?

Spinner

A short operation has no meaningful completion value

Progress bar

Uploading a file with reliable byte progress

Which component will you use here?
Difference and sources

Spinner communicates an indeterminate wait; Progress bar shows measurable completion, while Skeleton previews the shape of content still loading.

Read the sources

    Parts of the specimen

    Select a numbered marker on the schematic, or use the list below, to see its role. The schematic shows the concept's representative state.

    Status icon

    A redundant visual cue for the message type, never the only cue.

    Position in the atlas

    Relationship map

    Locate the chapter, neighboring concepts, and the next useful decision.

    • Chapter

      Wait and track progress

      Spinner belongs to this comparison group.

    • Do not confuse

      Progress bar

      Choose Spinner if the operation is short and has no meaningful completion value. Choose Progress bar if you know a reliable value, such as bytes sent or steps completed.

      Compare this pair
    • Do not confuse

      Skeleton

      Choose Spinner if the wait is short or the region is small, such as inside a button. Choose Skeleton if the loading region is large and its final shape is predictable, like a card or article.

      Compare this pair
    • Next step

      Compare the concepts in the chapter before choosing an implementation.

      Open the chapter

    In your own words

    Understand

    What people describe

    Documented aliases: loading spinner, activity indicator, busy indicator

    • a spinning mark while something loads
    • show that the button is still working
    • an unknown wait with no percentage
    • a small loader beside the status text
    • indicate background work in progress
    • a busy symbol when duration is uncertain

    Choose

    Use it when

    • A short operation has no meaningful completion value
    • A button must show that one request is pending

    Avoid it when

    • A known percentage can be reported
    • The wait is long enough to require progress detail or cancellation

    Compare

    Compare similar concepts

    Verification checklist

    Try these actions in the lab, then check the same behaviours in your agent’s result. Adapt the example names to your interface.

    1. 1. Do this

      Start the pending operation and try activating its start control again.

      Expected result

      The operation is identified as busy, duplicate submission is prevented, and no invented percentage is shown.

    2. 2. Do this

      Keep keyboard focus on the initiating control while the spinner appears, then complete the operation.

      Expected result

      Focus is not moved to the decorative spinner; success or failure replaces the waiting state with a clear result.

    3. 3. Do this

      Try the long-wait or failure case provided by your test example.

      Expected result

      Text explains what is happening and offers an appropriate recovery, such as retry or cancellation, instead of spinning forever.

    Full contract
    1. 1The wait is truly indeterminate
    2. 2A textual busy state accompanies the visual
    3. 3Duplicate actions are prevented
    4. 4The long-wait state offers explanation and recovery

    Understand → Recognize → Choose → Compare

    Pack for your agent

    Pre-written instructions to paste into your agent. Copying executes nothing.

    Implement correctly

    Build Spinner without breaking its behavior

    # Implement Spinner in your agent
    
    ## Objective
    Implement Spinner for this verified behavior: A compact animated indicator for work whose completion amount is unknown, paired with a meaningful busy status.
    
    ## Prerequisites
    - Inspect the repository, design system, and existing tests first.
    - Preserve unrelated changes and keep the file scope bounded.
    - Confirm that Spinner matches the need before writing code.
    
    ## Required behavior
    - The content region exposes its busy state while a separate visual indicator remains redundant.
    - A live region announces new status only when the update is important and not already focused.
    
    ## States to cover
    - Task idle
    - Task loading
    - Task taking longer than expected
    - Task cancelled
    - Task done
    
    ## Accessibility
    - ARIA role: status + [aria-busy=true]
    - The primary control or named region for Spinner has a stable accessible name from visible text or an explicit programmatic label; placeholder text and tooltips are not names.
    - Focus remains on the initiating control unless a documented transition replaces the whole view.
    - The indicator ends when work resolves or is cancelled; it is never a manually dismissible message by itself.
    - A concise status announces the start and final result, while the spinner graphic remains hidden from assistive technology.
    - Tab reaches the initiating control
    - The pending control blocks duplicate activation
    - Cancel remains keyboard reachable when offered
    
    ## When not to use
    - A known percentage can be reported
    - The wait is long enough to require progress detail or cancellation
    
    ## Acceptance criteria
    - The wait is truly indeterminate
    - A textual busy state accompanies the visual
    - Duplicate actions are prevented
    - The long-wait state offers explanation and recovery
    
    ## Guardrails
    - Show the proposed changes before any external action.
    - Do not publish, send, delete, pay for, or change remote state without explicit authorization.
    - Preserve unrelated changes and stop if the scope becomes ambiguous.
    
    ## Output format
    - Outcome or verdict.
    - Files or actions involved.
    - Checks run and observable evidence.
    - Remaining blockers or limitations.
    
    • Web platform
    • Requires · Access to the repository, design system, and tests
    Why it works
    • The need is tied to canonical behavior before any technical choice.
    • States, accessibility, and non-goals prevent a merely visual implementation.
    • Acceptance criteria and the output format make verification observable.

    Try next

    Verify Spinner on a real journey

    # Verify Spinner after implementation
    
    ## Objective
    Audit the Spinner implementation against its behavior, states, and accessibility requirements without changing it automatically.
    
    ## Checks
    - Replay the smallest representative journey.
    - Check keyboard behavior, focus, accessible name, and announcements.
    - Tie each gap to a specific acceptance criterion.
    
    ## Guardrails
    - Show the proposed changes before any external action.
    - Do not publish, send, delete, pay for, or change remote state without explicit authorization.
    - Preserve unrelated changes and stop if the scope becomes ambiguous.
    
    ## Output format
    - Outcome or verdict.
    - Files or actions involved.
    - Checks run and observable evidence.
    - Remaining blockers or limitations.
    

    sha256:976326a7e39cbcd784577b390266b74f076a09a55e3331d0fd96eb8e6fc3488d

    Diagnose a problem

    Find and fix the Spinner defect

    # Debug Spinner in your agent
    
    ## Observed symptom
    [DESCRIBE THE SYMPTOM HERE]
    
    ## Observable checks
    - Reproduce the issue with the smallest relevant journey.
    - Compare behavior with the documented states and transitions for Spinner.
    - Verify keyboard behavior, focus, accessible name, and announcements.
    
    ## Possible causes
    - The chosen primitive does not match the expected behavior.
    - A state, transition, or focus return is missing.
    - A neighboring component captures an event or hides an accessible signal.
    
    ## Bounded corrections
    - Fix the reproduced cause without recreating neighboring components.
    - Preserve the public contract and add a focused regression test.
    - Do not install dependencies or change remote state without authorization.
    
    ## Final verification
    - The wait is truly indeterminate
    - A textual busy state accompanies the visual
    - Duplicate actions are prevented
    - The long-wait state offers explanation and recovery
    
    ## Guardrails
    - Show the proposed changes before any external action.
    - Do not publish, send, delete, pay for, or change remote state without explicit authorization.
    - Preserve unrelated changes and stop if the scope becomes ambiguous.
    
    ## Output format
    - Outcome or verdict.
    - Files or actions involved.
    - Checks run and observable evidence.
    - Remaining blockers or limitations.
    
    • Web platform
    • Requires · Access to the repository, design system, and tests
    Why it works
    • The explicit symptom prevents starting from an assumed fix.
    • Checks separate behavior, accessibility, and neighboring interference.
    • The fix stays bounded and must produce regression evidence.

    Try next

    Lock in the Spinner fix

    # Prevent the Spinner regression
    
    ## Objective
    Turn the reproduced cause into a focused regression test and compare Spinner with neighboring concepts before widening the fix.
    
    ## Checks
    - Prove that the test fails before the fix.
    - Prove that it passes after the bounded fix.
    - Verify that no neighboring component changed behavior.
    
    ## Guardrails
    - Show the proposed changes before any external action.
    - Do not publish, send, delete, pay for, or change remote state without explicit authorization.
    - Preserve unrelated changes and stop if the scope becomes ambiguous.
    
    ## Output format
    - Outcome or verdict.
    - Files or actions involved.
    - Checks run and observable evidence.
    - Remaining blockers or limitations.
    

    sha256:97fd2f84f9ec9d5e892eb93853cda2f4de7eb37cb7b530e1d73398b6b4cb1c40

    Full entry, saving and provenance

    Pre-written instruction by SkillCodex — your request is neither sent nor used to adapt this text; no content is generated, and copying executes nothing.

    Pack digest: sha256:f4a4392cd5e8b6b74f78f831ba53955da93d8848bb672f14e6749a90ffbfc738

    In code

    TechnologyPrimitiveVersionCaveat
    Web platform

    status text plus decorative indicator

    NativeThe animated mark is visual only. The busy region and meaningful status text carry the accessible state.

    Technical details

    Behaviors

    • Mark the region busy

      The content region exposes its busy state while a separate visual indicator remains redundant.

    • Announce meaningful changes

      A live region announces new status only when the update is important and not already focused.

    States

    • Task idle

      Task idle

    • Task loading

      Task loading

    • Task taking longer than expected

      Task taking longer than expected

    • Task cancelled

      Task cancelled

    • Task done

      Task done

    State transitions

    • Task idle → Task loading

      An operation with unknown remaining duration starts and marks its region busy.

    • Task loading → Task taking longer than expected

      After the long-wait threshold, explanatory text and a Cancel action appear while saving continues.

    • Task taking longer than expected → Task done

      The save finishes, removes the spinner, and exposes the final Saved status with no further activation.

    • Task taking longer than expected → Task cancelled

      Activating Cancel stops the pending save and exposes Retry without losing the document.

    • Task cancelled → Task loading

      Activating Retry starts one new save and hides the prior cancellation status.

    • Task done → Task idle

      Reset restores the replayable save example to its initial ready state.

    Test scenarios

    Context
    A Save button sends a short request with unknown server duration.
    Mission
    Start saving, verify duplicate activation is blocked, read the busy status, and wait for the final status.
    Primary state
    The button exposes Saving, prevents a duplicate request, and shows a redundant animated indicator.
    Edge case
    After a long threshold, the interface adds explanatory text and a cancel or retry path instead of spinning forever.

    Visual signals

    • Small repeating motion
    • No measurable filled track
    • Placed near the busy control or region

    Behavioral signals

    • Runs only while work is pending
    • Does not imply a percentage
    • Meaningful status remains available independently of the animation

    Accessibility

    Role
    status + [aria-busy=true]
    Accessible name
    The primary control or named region for Spinner has a stable accessible name from visible text or an explicit programmatic label; placeholder text and tooltips are not names.
    Focus
    Focus remains on the initiating control unless a documented transition replaces the whole view.
    Dismissal
    The indicator ends when work resolves or is cancelled; it is never a manually dismissible message by itself.
    Scroll
    Loading and replacement content reserve enough space to prevent layout jumps and preserve the user's scroll position.
    Announcement
    A concise status announces the start and final result, while the spinner graphic remains hidden from assistive technology.
    Keyboard
    • Tab reaches the initiating control
    • The pending control blocks duplicate activation
    • Cancel remains keyboard reachable when offered

    Bindings

    Open the HTML, ARIA, Radix, and shadcn matrix
    • status text plus decorative indicator

      implementationKind
      custom
      nativeElement
      status text plus decorative indicator
      ariaPattern
      status and aria-busy on the updated region
      radixPrimitive
      Not applicable
      shadcnRecipe
      Not applicable
      runtimeDependency
      Not applicable
      packageName
      Not applicable
      exportName
      Not applicable
      exactVersion
      Not applicable
      status
      exception
      sourceId
      source-ui-wai-aria-busy
      deprecationStatus
      active
      replacement
      Not applicable
      validFrom
      Not applicable
      validUntil
      Not applicable

      Equivalence caveat: The animated mark is visual only. The busy region and meaningful status text carry the accessible state.

      Verify binding source

    Sources

    • shadcn/ui: Spinner
      sourceId
      source-ui-shadcn-spinner
      kind
      documentation
      canonicalUrl
      https://ui.shadcn.com/docs/components/radix/spinner
      publisher
      shadcn/ui
      sourceRevision
      http-etag:W/"sxjtkvu3hcht66"
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:79edfe5c0250aa78f2981bf6dbac2ca680d76d0b783d8df02ecaabca098fc9d3
      status
      verified

      Claim covered: Spinner: documented parts, state APIs, interaction behavior, and implementation limits for shadcn Spinner.

    • WAI-ARIA 1.2: aria-busy
      sourceId
      source-ui-wai-aria-busy
      kind
      standard
      canonicalUrl
      https://www.w3.org/TR/wai-aria-1.2/#aria-busy
      publisher
      W3C WAI
      sourceRevision
      W3C-REC-wai-aria-1.2-20230606
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:c0fea16fc747779569ab754d2d25bca3e2b7e8a673b8ef5362aeb9ebc73a4849
      status
      verified

      Claim covered: Spinner: the normative aria-busy state for exposing a region while its content is updating.

    • WCAG 2.2: Status Messages
      sourceId
      source-ui-wcag-understanding-status-messages
      kind
      documentation
      canonicalUrl
      https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html
      publisher
      W3C WAI
      sourceRevision
      http-last-modified:2026-07-02T10:07:49Z
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:cf2a8c16b20c1a94164c9a37e2b3f15d9a7d3f47d88385d47432d6a29655609e
      status
      verified

      Claim covered: Spinner: informative WCAG guidance for status messages announced without moving focus.

    • WAI-ARIA 1.2: Live Region Attributes
      sourceId
      source-ui-wai-aria-live-regions
      kind
      standard
      canonicalUrl
      https://www.w3.org/TR/wai-aria-1.2/#attrs_liveregions
      publisher
      W3C WAI
      sourceRevision
      W3C-REC-wai-aria-1.2-20230606
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:c0fea16fc747779569ab754d2d25bca3e2b7e8a673b8ef5362aeb9ebc73a4849
      status
      verified

      Claim covered: Spinner: normative live-region properties for status announcement behavior.

    • WAI-ARIA 1.2: Roles Model
      sourceId
      source-ui-wai-aria-roles
      kind
      standard
      canonicalUrl
      https://www.w3.org/TR/wai-aria-1.2/#roles
      publisher
      W3C WAI
      sourceRevision
      W3C-REC-wai-aria-1.2-20230606
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:c0fea16fc747779569ab754d2d25bca3e2b7e8a673b8ef5362aeb9ebc73a4849
      status
      verified

      Claim covered: Spinner: normative ARIA role definitions and constraints for the stated accessible role.