Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

1.5 KB
Raw Blame

coss Spinner

When to use

  • Indeterminate loading indicator for ongoing work.
  • Inline pending state in buttons, forms, and async panels.

Install

npx shadcn@latest add @coss/spinner

Manual deps from docs:

# No extra runtime dependency required for this primitive.

Canonical imports

import { Spinner } from "@/components/ui/spinner"

Minimal pattern

<div className="flex items-center gap-2">
  <Spinner aria-label="Loading" />
  <span className="text-sm text-muted-foreground">Loading data…</span>
</div>

Patterns from coss particles

Key patterns

Spinner inside a button:

<Button disabled>
  <Spinner aria-hidden="true" />
  Loading...
</Button>

Standalone spinner with label:

<div className="flex items-center gap-2">
  <Spinner aria-label="Loading" />
  <span className="text-muted-foreground text-sm">Fetching data...</span>
</div>

Prefer button built-in loading UI where available over ad-hoc spinner wrappers.

More examples

See p-button-18 and p-input-12 for spinner-in-button and spinner-in-input-group patterns.

Common pitfalls

  • Using spinner without accessible label/context for screen readers.
  • Showing spinner with no cancel/retry pathway in long-running operations.
  • Using spinner when determinate progress value is available.

Useful particle references

  • input group: p-input-12
  • button: p-button-18
  • cross-primitive pending states: p-button-25, p-autocomplete-12, p-toast-3