Your next page is taking shape...

Opening Your Next Page…

Loading the guide and preparing its examples for you to explore. The page will appear here automatically when it’s ready, so you can keep this view open without refreshing.

Made for Preact. Built to be yours.

Status & Feedback

Spinner

Spinner communicates async progress without blocking context. Explain what is happening, what changed and what someone can do next. Pair visual status with language that still makes sense without its color. Import it from @/components/kamod-ui/spinner.

Source · Design reference · API reference · Theming · Styles


Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width

Installation

Import Spinner from @/components/kamod-ui/spinner.

Install PackagesTerminal
pnpm add @kamod-ch/ui

Copy an example with @kamod-ch/ui or the matching @kamod-ch/ui/… subpath. The code block switches between those two installs. Connect The Global Theme CSS and Tailwind Source Detection before your first render.

Usage

Use Spinner for loading buttons, surfaces, and inline status updates with short descriptive copy.

Import SetupTypeScript
import { Spinner } from "@kamod-ch/ui";

Choose a complete composition from the examples below; required child components and props vary by pattern.

Component Examples & Variants

Explore Spinner in Different Contexts, from the starting pattern to the compositions below. Begin with Default, then compare the examples that match your content, state and layout. These are working patterns to adapt, not a list of interchangeable variant values: check the API Reference before using a prop or combining behaviors. Look at the surrounding labels, supporting text and spacing as well as the component itself.

Read the Result and Its Implementation Together. Use each showcase’s Code view to inspect imports and composition, or its Prompt view to prepare a setup or adaptation brief. Try the narrow preview and local theme controls before connecting real data, and use Reset to return an example to its initial state. Keep layout changes in class utilities where appropriate; follow the Component Styles Guide for hierarchy and the Theming Guide for shared surfaces and colors. The Accessibility Notes explain what to preserve when making those changes.

Default

Communicate Activity Alongside Readable Context. Place Spinner beside a concise loading message for work that is in progress but has no useful percentage. The rotating indicator supplies visual feedback while the text identifies what the application is doing.

Pair it with a useful status label, remove it when the task completes and provide a clear failure state instead of leaving motion running indefinitely.

src/components/SpinnerExample.tsx7 lines
import { Spinner } from "@kamod-ch/ui";

export const Example = () => (
  <div class="docs-spinner-center">
    <Spinner />
  </div>
);

Sizes

Match the Indicator to the Surrounding Control. Choose a spinner size that aligns with the adjacent text or control rather than the overall page heading. Comparing sizes in context keeps the loading indicator recognizable without allowing it to overpower a small action label.

Keep the accompanying text readable and avoid enlarging the graphic so much that it becomes more prominent than the task explanation.

Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width

Tones

Choose Emphasis According to the Loading Context. Use the spinner's tone options to match a quiet inline status or a more prominent loading region. Its color should complement the surrounding surface while the message still explains the operation independently of that visual emphasis.

Check contrast against the actual surface and keep a text status available; changing color does not explain the operation or its result.

Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width

Buttons

Keep the Action Recognizable While It Runs. Combine Spinner with a pending button label and disabled state during an asynchronous action. Drive all three from the same operation so the visual feedback and protection against repeated activation begin and end together.

Restore a usable action after failure and communicate the result separately; the spinner should not be the only evidence that anything happened.

Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width

Loading Surface

Explain Longer Waits without Overwhelming the Page. Place a spinner in a dedicated status region when work lasts long enough to need an explanation. Include what is happening and any useful next step, rather than filling the larger surface with an indicator alone.

Keep unrelated controls available when safe, cancel application-owned work on cleanup where appropriate and replace the loading surface with a clear result.

Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width

Loading Overlay

Block Interaction Only When the Task Requires It. Use a spinner with a subtle backdrop only when the pending transition genuinely blocks the covered region. The surrounding state should explain why controls are unavailable and restore their use when the operation resolves.

Keep focus behavior deliberate, avoid hiding the only cancellation route and remove the blocking state on failure as well as success.

Interactive Live Preview
Try it. Make it yours.
Setting the scene...

Interactive preview

Live Preact example Local preview theme · Responsive styles follow the preview widthFull width
API reference

Props and Data

Configure Spinner using the contracts below. Read the documented options alongside the Source Definitions to understand which values your application supplies and which details the component owns. Start with a prop or helper, then follow its type link to inspect the declaration without leaving the page.

Props, slots and variants for this component.

API reference
Your API, from source

Type cards are extracted from this checkout’s TypeScript source at build time. Props inherited through HTMLAttributes, Omit or variant helpers remain references in those declarations; their fields are not flattened here. Match the reference to your installed version, and check a package’s exports before writing an import type. A type exported by a source file is not necessarily re-exported by @kamod-ch/ui.

Component Props

Read each option with its owning component. The
marker identifies required fields verified in that declaration. A ? means a field can be omitted; it does not promise a fallback value. Existing documented defaults remain alongside the descriptions. For callbacks, check the argument and return types before connecting your own state or services.
@kamod-ch/ui/spinner2.0 KB min · 0.8 KB gzipSignals: none

Spinner

SpinnerProps

Spinner documented props
Prop / typeDescription
class
string | SignalLike<string | undefined>SpinnerProps

Configure class for Spinner. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
size
"xs" | "sm" | "lg" | "md" | "xl"SpinnerProps

Configure size for Spinner. Compare its accepted type with the Usage Guidance before supplying a value.

Default
"sm"
strokeWidth
numberSpinnerProps

Configure strokeWidth for Spinner. Compare its accepted type with the Usage Guidance before supplying a value.

Default
2.5
tone
"default" | "primary" | "muted"SpinnerProps

Configure tone for Spinner. Compare its accepted type with the Usage Guidance before supplying a value.

Default
"default"

Data Type Reference

Expand a card to inspect and copy the exact declaration. The code header identifies its repository file; follow imported or inherited types in the Implementation Source when you need the complete dependency chain. Required-field summaries cover fields declared directly in that type. Source-only helpers and inferred schema outputs describe the local implementation, not additional props you can pass to every component.

Spinner Props

3 declared fields
SpinnerProps
Exported Source Declaration from Spinner.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SpinnerProps before adapting it.

Accessibility

Spinner includes role="status" and a default Loading label; its SVG is decorative. The default communicates generic activity, while your interface must explain which operation is in progress and what happens next.

Take the Next Useful Step

You have the pieces. Put them into one real interaction, keep its state in one place, and check the result with the content your application will actually show.

Connect the Foundation

Return to Choose and Compose Components to connect this reference to a working screen. Keep global CSS in one entrypoint and import only the components that screen needs.

Build the Surrounding Screen

Find a neighboring interaction in the Component Library, or start with a complete Block. Replace sample content and destinations before refining the layout; a local class change can stay with the composition.

Make the Result Hold Up

Use shared theme roles for changes that belong everywhere. Then review the whole journey: keyboard focus, long labels, narrow screens and a clear way to recover when something fails.

Keep a link to the source and note your intentional changes. Your next edit should begin with a clear decision, not another search.