---
title: "Progress"
description: "Displays an indicator showing the completion progress of a task, typically displayed as a progress bar."
component: true
---

```tsx
import { Progress } from "~/components/ui/progress"

export default function ProgressDemo() {
  return (
    <div class="grid w-full max-w-sm gap-4">
      <Progress value={25} />
      <Progress value={50} />
      <Progress value={80} />
    </div>
  )
}
```

## Installation

<CodeTabs>

<TabsList>
  <TabsTrigger value="cli">Command</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>

<TabsContent value="cli">

```bash
npx solidui-cli@latest add progress
```

</TabsContent>

<TabsContent value="manual">

<Steps class="mb-0 pt-2">

<Step>Install the following dependencies:</Step>

```bash
npm install @ui-sdk/solid @ui-sdk/core
```

<Step>Copy and paste the following code into your project.</Step>

```tsx title="components/ui/progress.tsx"
import { type ComponentProps } from "@solidjs/web"
import {
  Progress as SdkProgress,
  ProgressTrack as SdkProgressTrack,
  ProgressIndicator as SdkProgressIndicator,
  ProgressLabel as SdkProgressLabel,
  ProgressValue as SdkProgressValue
} from "@ui-sdk/solid/progress"
import { omit } from "solid-js"

import { cn } from "~/lib/utils"
type ProgressProps = Omit<ComponentProps<typeof SdkProgress>, "class"> & {
  class?: string
}
const Progress = (props: ProgressProps) => {
  const others = omit(props, "class", "children")
  return (
    <SdkProgress class={cn("w-full", props.class)} {...others}>
      {props.children}
      <SdkProgressTrack
        class={cn("h-1 rounded-full bg-muted h-1 rounded-full bg-muted relative overflow-hidden")}
      >
        <SdkProgressIndicator
          class={cn(
            "bg-primary h-full w-(--progress-value) transition-all"
          )}
        />
      </SdkProgressTrack>
    </SdkProgress>
  )
}
type ProgressLabelProps = Omit<
  ComponentProps<typeof SdkProgressLabel>,
  "class"
> & {
  class?: string
}
const ProgressLabel = (props: ProgressLabelProps) => (
  <SdkProgressLabel {...props} class={cn("text-sm font-medium", props.class)} />
)
type ProgressValueProps = Omit<
  ComponentProps<typeof SdkProgressValue>,
  "class"
> & {
  class?: string
}
const ProgressValue = (props: ProgressValueProps) => (
  <SdkProgressValue {...props} class={cn("ml-auto text-sm text-muted-foreground tabular-nums", props.class)} />
)
export {
  Progress,
  ProgressLabel,
  ProgressValue,
  type ProgressLabelProps,
  type ProgressProps,
  type ProgressValueProps
}
```

<Step>Update the import paths to match your project setup.</Step>

</Steps>

</TabsContent>

</CodeTabs>

## Usage

```tsx
import { Progress } from "~/components/ui/progress"
```

```tsx showLineNumbers
<Progress value={65} />
```

## Label

Use a `Field` component to add a label to the progress bar.

```tsx
import { Field, FieldLabel } from "~/components/ui/field"
import { Progress } from "~/components/ui/progress"

export default function ProgressWithLabel() {
  return (
    <Field class="w-full max-w-sm">
      <FieldLabel for="progress-upload">
        <span>Upload progress</span>
        <span class="ml-auto">66%</span>
      </FieldLabel>
      <Progress value={66} id="progress-upload" />
    </Field>
  )
}
```

## Controlled

A progress bar that can be controlled by a slider.

```tsx
import { createSignal } from "solid-js"

import { Progress } from "~/components/ui/progress"
import { Slider } from "~/components/ui/slider"

export default function ProgressControlled() {
  const [value, setValue] = createSignal([50])

  return (
    <div class="flex w-full max-w-sm flex-col gap-4">
      <Progress value={value()[0] ?? 0} class="w-full" />
      <Slider
        max={100}
        min={0}
        onValueChange={setValue}
        step={1}
        value={value()}
      />
    </div>
  )
}
```

## API Reference

| Part            | Description                                                     |
| --------------- | --------------------------------------------------------------- |
| `Progress`      | Root container that manages progress state and ARIA attributes. |
| `ProgressLabel` | Accessible text label associated with the progress bar.         |
| `ProgressValue` | Formatted value label generated from progress state.            |

`Progress` renders the track and indicator internally.

See the [UI SDK](https://ui-sdk.dev/docs/solid/components/progress) documentation for more information.
