Inputs

Upload Queue

An upload queue you can leave: every row has its own progress bar and its own cancel button that names the file rather than the row number.

  • file
  • upload
  • progress
  • cancel

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/file-003?lang=en

Uploading 3 files

  • brand-guide.pdf4,2 МБ · загружен
  • hero-desktop@2x.png8,7 МБ · 64%
  • screencast-onboarding.mp4128 МБ · 18%
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 "file-003" (Upload Queue) 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/file-003.json

Registry item: https://vibeui.ru/r/file-003.json
Installs to: components/vibeui/file-003.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
An upload queue you can leave: every row has its own progress bar and its own cancel button that names the file rather than the row number.

A list of uploading files: name, size, share, a native progress bar and a cancel button per row. Finished rows switch the bar colour and the button caption — the action there is a different one. Zero dependencies, one file, its own palette.

## 3. How to use it
import { File003 } from "@/components/vibeui/file-003"

<File003
  title="Uploading 3 files"
  items={[{ id: "1", name: "brief.pdf", size: "4.2 MB", progress: 64 }]}
  onCancel={(id) => abort(id)}
/>

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-file-003-* palette — do not swap it for your theme tokens (bg-primary, bg-muted and the like)
- the native <progress> instead of a stack of divs: the share, the role and the announcement come for free
- the aria-label naming the file on every bar — otherwise in a list of seven rows it is unclear whose progress it is
- a cancel button on every row: without it progress is just watching someone else work
- the file name in the button label rather than the row number — "cancel the second one" means nothing aloud
- separate "Cancel" and "Remove" captions: aborting an upload and deleting a finished file are different actions
- the <style> block inside the component — it holds the palette, the row layout and the bar styling

## 6. You may change
- the title above the list
- the items array: names, sizes and progress values come from outside
- the onCancel handler — abort the request and drop the file from the queue there
- the accent through the accent prop — it colours the progress bar
- the empty-state wording

## 7. Rules
- The component uploads nothing and computes no progress: the values arrive as a prop and the caller updates them.
- Cancelling here only removes the row — abort the actual request inside onCancel, or the file keeps uploading.
- Do not show percentages when the server does not report the size: a bar with no data lies more convincingly than no bar at all.
- 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/file-003.json
https://vibeui.ru/r/file-003.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-file-003-*. Клиентский: "use client" ради отмены. Прогресс — нативный <progress> с aria-label по имени файла, поэтому доля и подпись достаются вспомогательным технологиям без ручной разметки. Строки со стопроцентным прогрессом получают data-done: полоска зеленеет, а кнопка меняет подпись с «Отменить» на «Убрать». Значения прогресса приходят пропом items — компонент их не считает.

Component source

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

"use client"

import { useState } from "react"
import type { ComponentPropsWithoutRef, CSSProperties } from "react"

export type File003Item = {
  id: string
  name: string
  size: string
  progress: number
}

export type File003Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children" | "onChange"
> & {
  title?: string
  items?: File003Item[]
  onCancel?: (id: string) => void
  accent?: string
}

// Идея компонента: очередь загрузки, из которой можно выйти. Прогресс без
// отмены — это наблюдение за чужой работой: пользователь уже понял, что
// перепутал файл, а полоска всё ещё ползёт. Здесь у каждой строки своя
// полоска на нативном <progress> и своя кнопка отмены, называющая файл по
// имени, а завершённые строки меняют кнопку на «Убрать» — действие другое.
const STYLES = `
:where([data-vibeui-block="file-003"]){
--vibeui-file-003-surface:oklch(1 0 0);
--vibeui-file-003-fg:oklch(0.23 0.014 265);
--vibeui-file-003-muted:oklch(0.55 0.014 265);
--vibeui-file-003-border:oklch(0.89 0.008 265);
--vibeui-file-003-shell:oklch(0.91 0.006 265);
--vibeui-file-003-track:oklch(0.93 0.006 265);
--vibeui-file-003-accent:oklch(0.55 0.18 255);
--vibeui-file-003-ok:oklch(0.52 0.13 155);
--vibeui-file-003-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Своя светлая подложка: очередь показывают поверх любого фона. */
[data-vibeui-block="file-003"]{
display:flex;flex-direction:column;gap:0.5rem;
width:100%;max-width:24rem;box-sizing:border-box;padding:0.875rem;
background:var(--vibeui-file-003-surface);
border:1px solid var(--vibeui-file-003-shell);border-radius:0.875rem;
font-family:var(--vibeui-file-003-font);color:var(--vibeui-file-003-fg);
}
[data-vibeui-block="file-003"] *{box-sizing:border-box}
[data-vibeui-block="file-003"] h3{margin:0;font-size:0.8125rem;font-weight:650}
[data-vibeui-block="file-003"] ul{display:flex;flex-direction:column;gap:0.5rem;margin:0;padding:0;list-style:none}
[data-vibeui-block="file-003"] li{
display:grid;grid-template-columns:1fr auto;align-items:center;gap:0.25rem 0.625rem;
padding:0.5rem 0.625rem;border-radius:0.625rem;
border:1px solid var(--vibeui-file-003-border);
}
[data-vibeui-block="file-003"] [data-part="name"]{
min-width:0;font-size:0.8125rem;font-weight:600;
overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
[data-vibeui-block="file-003"] [data-part="meta"]{
grid-column:1;font-size:0.6875rem;color:var(--vibeui-file-003-muted);
font-variant-numeric:tabular-nums;
}
/* Нативный <progress>: доля и подпись достаются вспомогательным технологиям даром. */
[data-vibeui-block="file-003"] progress{
grid-column:1 / -1;appearance:none;width:100%;height:0.3125rem;border:0;
background:var(--vibeui-file-003-track);border-radius:9999px;overflow:hidden;
}
[data-vibeui-block="file-003"] progress::-webkit-progress-bar{background:var(--vibeui-file-003-track);border-radius:9999px}
[data-vibeui-block="file-003"] progress::-webkit-progress-value{background:var(--vibeui-file-003-accent);border-radius:9999px;transition:inline-size .2s ease}
[data-vibeui-block="file-003"] progress::-moz-progress-bar{background:var(--vibeui-file-003-accent);border-radius:9999px}
[data-vibeui-block="file-003"] li[data-done="true"] progress::-webkit-progress-value{background:var(--vibeui-file-003-ok)}
[data-vibeui-block="file-003"] li[data-done="true"] progress::-moz-progress-bar{background:var(--vibeui-file-003-ok)}
[data-vibeui-block="file-003"] li[data-done="true"] [data-part="meta"]{color:var(--vibeui-file-003-ok);font-weight:600}
/* Кнопка называет файл: «отменить» без имени бесполезно в списке из семи строк. */
[data-vibeui-block="file-003"] button{
grid-row:1 / 3;grid-column:2;align-self:center;
appearance:none;cursor:pointer;
width:1.75rem;height:1.75rem;padding:0;border-radius:0.5rem;
border:1px solid var(--vibeui-file-003-border);
background:none;color:var(--vibeui-file-003-muted);
font:inherit;font-size:0.875rem;line-height:1;
transition:color .16s ease,border-color .16s ease;
}
[data-vibeui-block="file-003"] button:hover{color:var(--vibeui-file-003-fg);border-color:var(--vibeui-file-003-muted)}
[data-vibeui-block="file-003"] button:focus-visible{outline:2px solid var(--vibeui-file-003-accent);outline-offset:2px}
[data-vibeui-block="file-003"] [data-part="empty"]{
margin:0;padding:0.75rem 0;font-size:0.8125rem;color:var(--vibeui-file-003-muted);
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="file-003"] *{animation:none!important;transition:none!important}}
`

const DEFAULT_ITEMS: File003Item[] = [
  { id: "1", name: "brand-guide.pdf", size: "4,2 МБ", progress: 100 },
  { id: "2", name: "hero-desktop@2x.png", size: "8,7 МБ", progress: 64 },
  { id: "3", name: "screencast-onboarding.mp4", size: "128 МБ", progress: 18 },
]

/**
 * Очередь загрузки: полоска прогресса и отмена на каждой строке.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function File003({
  title = "Загружается 3 файла",
  items = DEFAULT_ITEMS,
  onCancel,
  accent,
  className,
  style,
  ...props
}: File003Props) {
  const [list, setList] = useState(items)

  const palette = {
    ...(accent ? { "--vibeui-file-003-accent": accent } : null),
    ...style,
  } as CSSProperties

  const drop = (id: string) => {
    setList((current) => current.filter((entry) => entry.id !== id))
    onCancel?.(id)
  }

  return (
    <>
      <style href="vibeui-file-003" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="file-003"
        className={className}
        style={palette}
      >
        <h3>{title}</h3>
        {list.length === 0 ? (
          <p data-part="empty">Очередь пуста — все загрузки отменены.</p>
        ) : (
          <ul>
            {list.map((entry) => {
              const done = entry.progress >= 100

              return (
                <li key={entry.id} data-done={done ? "true" : undefined}>
                  <span data-part="name">{entry.name}</span>
                  <span data-part="meta">
                    {done
                      ? `${entry.size} · загружен`
                      : `${entry.size} · ${entry.progress}%`}
                  </span>
                  <progress
                    max={100}
                    value={entry.progress}
                    aria-label={`Загрузка файла ${entry.name}`}
                  />
                  <button
                    type="button"
                    aria-label={
                      done ? `Убрать ${entry.name}` : `Отменить ${entry.name}`
                    }
                    onClick={() => drop(entry.id)}
                  >
                    ×
                  </button>
                </li>
              )
            })}
          </ul>
        )}
      </div>
    </>
  )
}