Display

Labelled Spinner

A spinner with a mandatory label: a ring alone says neither what is happening nor how long it takes.

  • spinner
  • loading
  • status
  • a11y

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.

put this in the header: https://vibeui.ru/c/spinner-001?lang=en

Building the catalogUsually under a minute
Show the full instructions

What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.

# Install and place "spinner-001" (Labelled Spinner) from VibeUI

## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/spinner-001.json

Registry item: https://vibeui.ru/r/spinner-001.json
Installs to: components/vibeui/spinner-001.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.

Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.

## 2. What it is
A spinner with a mandatory label: a ring alone says neither what is happening nor how long it takes.

A loading indicator: a ring, the action's name and a time estimate. Three sizes, pulsing instead of spinning when motion is reduced. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Spinner001 } from "@/components/vibeui/spinner-001"

<Spinner001 label="Building the catalog" hint="Under a minute" size="md" />

Read the installed file for the full prop list.

## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.

Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)

## 5. Keep exactly as installed
- the local --vibeui-spinner-001-* palette — do not swap it for your theme tokens
- the mandatory label: a ring does not say what is running
- role="status" with aria-live — waiting has to be heard
- pulsing instead of spinning under prefers-reduced-motion: the state stays visible
- its own light surface: waiting gets shown over any background
- the single size variable so the ring matches the type beside it
- the time estimate when it is known

## 6. You may change
- label and hint
- size — sm, md or lg
- the accent through the accent prop
- the ring thickness

## 7. Rules
- Do not invent the estimate: a wrong one annoys more than none.
- Past a couple of seconds show progress or a reason rather than a ring.
- Do not use a spinner in place of list content: skeletons exist for that.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.

## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.

For developers

npx shadcn@latest add https://vibeui.ru/r/spinner-001.json
https://vibeui.ru/r/spinner-001.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-spinner-001-*. Серверный: хуков нет. Кольцо собрано из бордюра с окрашенной верхней гранью, размер задаётся одной переменной. Блок объявлен role="status" с aria-live. При prefers-reduced-motion вращение заменяется пульсацией прозрачности.

Component source

The same file your agent installs. Here in case you would rather copy it by hand.

import type { ComponentPropsWithoutRef, CSSProperties } from "react"

export type Spinner001Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children"
> & {
  label?: string
  hint?: string
  size?: "sm" | "md" | "lg"
  accent?: string
}

// Идея компонента: ожидание с подписью. Крутящееся кольцо само по себе не
// сообщает ничего — ни что происходит, ни сколько ждать; подпись обязательна,
// а не опциональна. При prefers-reduced-motion вращение сменяется пульсацией
// прозрачности: движение уходит, состояние остаётся.
const STYLES = `
:where([data-vibeui-block="spinner-001"]){
--vibeui-spinner-001-size:1.5rem;
--vibeui-spinner-001-bg:oklch(1 0 0);
--vibeui-spinner-001-border:oklch(0.9 0.006 265);
--vibeui-spinner-001-fg:oklch(0.28 0.014 265);
--vibeui-spinner-001-muted:oklch(0.56 0.014 265);
--vibeui-spinner-001-track:oklch(0.9 0.006 265);
--vibeui-spinner-001-accent:oklch(0.55 0.17 265);
--vibeui-spinner-001-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Своя светлая подложка: ожидание показывают поверх любого фона. */
[data-vibeui-block="spinner-001"]{
display:inline-flex;align-items:center;gap:0.625rem;
box-sizing:border-box;padding:0.75rem 1rem;
background:var(--vibeui-spinner-001-bg);
border:1px solid var(--vibeui-spinner-001-border);border-radius:0.875rem;
font-family:var(--vibeui-spinner-001-font);color:var(--vibeui-spinner-001-fg);
}
[data-vibeui-block="spinner-001"][data-size="sm"]{--vibeui-spinner-001-size:1rem}
[data-vibeui-block="spinner-001"][data-size="lg"]{--vibeui-spinner-001-size:2rem}
[data-vibeui-block="spinner-001"] [data-part="ring"]{
flex:none;box-sizing:border-box;
width:var(--vibeui-spinner-001-size);height:var(--vibeui-spinner-001-size);
border:2px solid var(--vibeui-spinner-001-track);
border-top-color:var(--vibeui-spinner-001-accent);
border-radius:9999px;
animation:vibeui-spinner-001-spin .7s linear infinite;
}
@keyframes vibeui-spinner-001-spin{to{transform:rotate(360deg)}}
@keyframes vibeui-spinner-001-pulse{0%,100%{opacity:.35}50%{opacity:1}}
[data-vibeui-block="spinner-001"] [data-part="text"]{display:flex;flex-direction:column;gap:0.0625rem;min-width:0}
[data-vibeui-block="spinner-001"] [data-part="label"]{font-size:0.875rem;font-weight:650;line-height:1.2}
[data-vibeui-block="spinner-001"] [data-part="hint"]{font-size:0.75rem;color:var(--vibeui-spinner-001-muted)}
/* Без движения состояние остаётся: кольцо не крутится, а пульсирует. */
@media (prefers-reduced-motion:reduce){
[data-vibeui-block="spinner-001"] [data-part="ring"]{
animation:vibeui-spinner-001-pulse 1.6s ease-in-out infinite;
border-color:var(--vibeui-spinner-001-accent);
}
}
`

/**
 * Ожидание с обязательной подписью: кольцо без слов ничего не сообщает.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Spinner001({
  label = "Собираем каталог",
  hint = "Обычно занимает меньше минуты",
  size = "md",
  accent,
  className,
  style,
  ...props
}: Spinner001Props) {
  const palette = {
    ...(accent ? { "--vibeui-spinner-001-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-spinner-001" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="spinner-001"
        data-size={size}
        role="status"
        aria-live="polite"
        className={className}
        style={palette}
      >
        <span data-part="ring" aria-hidden="true" />
        <span data-part="text">
          <span data-part="label">{label}</span>
          {hint ? <span data-part="hint">{hint}</span> : null}
        </span>
      </div>
    </>
  )
}