Ballmac UI home

Queues 1: job queues

The queues behind a product: jobs waiting, arrival and finish rates, the age of the oldest job, a queue that is filling faster than it drains called out in words, failed jobs with their errors to retry or discard, and a pause switch.

State

The normal view. Pick a state to see what the block shows while it loads, is empty or fails.

Open in v0 (opens in a new tab)

Installation

$ pnpm dlx shadcn@latest add @ballmac/queues-1

Usage

Example: queues-1-demo.tsx
"use client"

import { Queues1 } from "@/components/ballmac/blocks/queues-1/queues-1"

export default function Queues1Demo() {
  return <Queues1 defaultOpenId="email" onPause={() => new Promise((r) => setTimeout(r, 400))} onRetryJobs={() => new Promise((r) => setTimeout(r, 400))} onDiscard={() => new Promise((r) => setTimeout(r, 400))} />
}

States

Pass state and the block does the rest: skeletons that match its layout, a clear empty message, an error you can retry, and announcements for screen readers.

  • Loading

    Skeleton rows under the real heading, announced as loading.

    state="loading"
  • No queues yet

    Says no queues yet; emptyState sets the copy.

    state="empty"
  • Could not load

    An alert saying no jobs were changed, with Try again (onRetry). A failed pause or retry puts things back and says why.

    state="error"

Dependencies

Use with AI

Background job queues. <Queues1 queues={[{ id, name, depth, inRate, outRate, oldest: '9 min', paused?, series: number[], failed: [{ id, name, error, attempts, at }] }]} defaultOpenId='email' onPause={(queueId, paused) => Promise} onRetryJobs={(queueId, jobId | 'all') => Promise} onDiscard={(queueId, jobId) => Promise} />. A queue is 'Backing up' when jobs arrive over 1.2 times faster than they finish and over 100 wait. Each action updates the screen and reports success or the error. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Queues 1: job queues (@ballmac/queues-1) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • An operations view of workers and background jobs
  • Finding and retrying jobs that failed

Not for

  • Scheduled jobs and their next runs; use cron-1
  • A deploy's stages; use pipeline-1

Registry JSON: https://ui.ballmac.com/r/queues-1.json

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.