ZaidanHomeDocsComponentsBlocksChartsTypesetCreate

Command Palette

Search for a command to run...

GitHub
New
Sections
  • Introduction
  • Components
  • Blocks
  • Installation
  • Customization
  • Dark Mode
  • Typeset
  • Zaidan Skills
  • FAQ
  • Roadmap
  • Changelog
Installation
  • Astro
  • Manual
  • Solid Start
  • TanStack Router
  • TanStack Start
  • Vite
Blocks
  • Data Grid
  • Event Calendar
  • Filters
  • Gantt
  • Image Crop
  • Kanban
  • Message Scroller
  • Questionnaire
  • Sortable
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Aspect Ratio
  • Attachment
  • Avatar
  • Badge
  • Breadcrumb
  • Bubble
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Collapsible
  • Combobox
  • Command
  • Context Menu
  • Dialog
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kbd
  • Label
  • Marker
  • Menubar
  • Message
  • Native Select
  • Navigation Menu
  • Pagination
  • Popover
  • Progress
  • Radio Group
  • Resizable
  • Scroll Area
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Spinner
  • Switch
  • Table
  • Tabs
  • Textarea
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip

Progress

Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.

Kobalte
Kobalte

The Progress component is built on top of Kobalte Progress, which provides the accessible progress primitive.

1
import { createSignal, onCleanup, onMount } from "solid-js";
2
import { Progress } from "~/components/ui/progress";
3
4
export default function ProgressDemo() {
5
const [progress, setProgress] = createSignal(13);
6
7
onMount(() => {
8
const timer = window.setTimeout(() => setProgress(66), 500);
9
onCleanup(() => window.clearTimeout(timer));
10
});
11
12
return <Progress value={progress()} class="w-[60%]" />;
13
}

Installation

pnpm dlx shadcn@latest add @zaidan/progress
npx shadcn@latest add @zaidan/progress
yarn dlx shadcn@latest add @zaidan/progress
bunx --bun shadcn@latest add @zaidan/progress

Usage

1
import { Progress } from "~/components/ui/progress";
1
<Progress value={33} />

Composition

With label and value

Use ProgressLabel and ProgressValue to add a label and value display.

1
import {
2
Progress,
3
ProgressLabel,
4
ProgressValue,
5
} from "~/components/ui/progress";
6
7
<Progress value={56} class="w-full max-w-sm">
8
<ProgressLabel>Upload progress</ProgressLabel>
9
<ProgressValue />
10
</Progress>
Progress
├── ProgressLabel
├── ProgressValue
└── ProgressTrack
└── ProgressIndicator

Label

Use ProgressLabel and ProgressValue to add a label and value display.

Upload progress
56%
1
import { Progress, ProgressLabel, ProgressValue } from "~/components/ui/progress";
2
3
export default function ProgressLabelDemo() {
4
return (
5
<Progress value={56} class="w-full max-w-sm">
6
<ProgressLabel>Upload progress</ProgressLabel>
7
<ProgressValue />
8
</Progress>
9
);
10
}

Controlled

A progress bar that can be controlled by a slider.

1
import { createSignal } from "solid-js";
2
import { Progress } from "~/components/ui/progress";
3
import { Slider } from "~/components/ui/slider";
4
5
export default function ProgressControlled() {
6
const [value, setValue] = createSignal(50);
7
8
return (
9
<div class="flex w-full max-w-sm flex-col gap-4">
10
<Progress value={value()} class="w-full" />
11
<Slider
12
value={[value()]}
13
onChange={(values) => setValue(values[0])}
14
minValue={0}
15
maxValue={100}
16
step={1}
17
aria-label="Progress value"
18
/>
19
</div>
20
);
21
}

Indeterminate

Use the indeterminate prop to show an indeterminate progress state.

Processing...
1
import { Progress, ProgressLabel } from "~/components/ui/progress";
2
3
export default function ProgressIndeterminate() {
4
return (
5
<Progress indeterminate class="w-full max-w-sm">
6
<ProgressLabel>Processing...</ProgressLabel>
7
</Progress>
8
);
9
}

Custom Value Range

Use minValue and maxValue to set custom value ranges.

5 of 10 tasks completed
50%
1
import { Progress, ProgressLabel, ProgressValue } from "~/components/ui/progress";
2
3
export default function ProgressRange() {
4
return (
5
<Progress value={5} minValue={0} maxValue={10} class="w-full max-w-sm">
6
<div class="flex w-full justify-between">
7
<ProgressLabel>5 of 10 tasks completed</ProgressLabel>
8
<ProgressValue />
9
</div>
10
</Progress>
11
);
12
}

API Reference

See the Kobalte Progress API reference for primitive props, accessibility, and progress semantics.

On This Page

  • Installation
  • Usage
  • Composition
    • With label and value
  • Label
  • Controlled
  • Indeterminate
  • Custom Value Range
  • API Reference
Built by Kevin Abatan. The source code is available on GitHub.