Skip to main content

Starwind UI v3.0 is now available! Migration guide

Installation

Usage

---
import { Progress } from "@/components/starwind/progress";
---
<div class="w-full max-w-[400px]">
<Progress id="demo-progress" value={50} />
</div>

Variants

Indeterminate

When you need to show a loading state without a specific value, omit the value prop to create an indeterminate progress bar.

Dynamic Updates

The Progress component can be updated dynamically by changing the data-value attribute. This is useful for showing real-time progress like file uploads, form completion, or step-by-step processes.

Interactive Progress Example

API Reference

Styled Component API

These props are added or materially changed by the installed styled component. Standard HTML attributes remain available through the inherited interfaces noted below. Expand a prop to see named type definitions and framework-specific imports. Follow the Primitive and Runtime links for lower-level behavior props.

Progress

Inherits div attributes. Omits `value`.

Contains the following additional props:

Prop Type Default Toggle details
label string —
Description
Provides accessible text for the component.
Classification
Wrapper prop
max number 100
Description
Sets the maximum accepted value.
Classification
Wrapper prop
min number 0
Description
Sets the minimum accepted value.
Classification
Wrapper prop
value number | null null
Description
Controls or identifies the component value.
Classification
Wrapper prop
variant "default" | "primary" | "secondary" | "info" | "success" | "warning" | "error" "default"
Description
Selects the component's visual variant.
Classification
Wrapper prop

Primitive And Runtime API

Use these references when you need the lower-level behavior APIs behind Progress.

Primitive API

Runtime API

Progress primitive
createProgress from @starwind-ui/runtime/progress

Changelog

View version history v2.0.3 8 releases

v2.0.3

  • Progress indicators now use the neutral default color variant when color is omitted.

v2.0.2

  • In React, you can cancel a change before it applies. The component then keeps its previous state, and it shows only the changes that apply.

v2.0.1

  • Astro and React Progress now handle a min greater than max, an equal min and max, and invalid or infinite values in the same way.
  • The indicator no longer animates when Progress changes between a value and the indeterminate state. A change from one value to another still animates, and reduced motion still applies.

v2.0.0

  • Progress now gets its behavior from Starwind Runtime. Runtime handles the value and the indeterminate state.
  • See the Progress Primitive for the unstyled parts and the behavior API.

v1.1.3

  • The Tailwind variants now live in their own variants.ts file in the component folder.

v1.1.1

  • Add starwind:init event listener to enable initialization of additional Progress loaded after an initial page load, such as when using server islands

v1.1.0

  • Add data-slot attribute to enable global styling updates

v1.0.0

  • Initial release with starwind v1.7.0