> ## Documentation Index
> Fetch the complete documentation index at: https://araf.badr.co.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Progress

> A horizontal bar that visually communicates task completion or loading state — supports 4 semantic color variants and 3 sizes.

## Overview

<div style={{display:"flex",flexDirection:"column",gap:"16px",padding:"28px 24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb"}}>
  <div style={{display:"flex",flexDirection:"column",gap:"6px"}}>
    <div style={{display:"flex",justifyContent:"space-between"}}>
      <span style={{fontSize:"13px",color:"#667085",fontFamily:"Inter,sans-serif"}}>Uploading...</span>
      <span style={{fontSize:"13px",color:"#667085",fontFamily:"Inter,sans-serif"}}>60%</span>
    </div>

    <div style={{height:"8px",background:"#E5E7EB",borderRadius:"4px",overflow:"hidden"}}>
      <div style={{height:"100%",width:"60%",background:"#0479CE",borderRadius:"4px"}} />
    </div>
  </div>

  <div style={{display:"flex",flexDirection:"column",gap:"6px"}}>
    <div style={{display:"flex",justifyContent:"space-between"}}>
      <span style={{fontSize:"13px",color:"#027A48",fontFamily:"Inter,sans-serif"}}>Complete</span>
      <span style={{fontSize:"13px",color:"#027A48",fontFamily:"Inter,sans-serif"}}>100%</span>
    </div>

    <div style={{height:"8px",background:"#E5E7EB",borderRadius:"4px",overflow:"hidden"}}>
      <div style={{height:"100%",width:"100%",background:"#16A34A",borderRadius:"4px"}} />
    </div>
  </div>

  <div style={{display:"flex",flexDirection:"column",gap:"6px"}}>
    <div style={{display:"flex",justifyContent:"space-between"}}>
      <span style={{fontSize:"13px",color:"#B54708",fontFamily:"Inter,sans-serif"}}>Almost full</span>
      <span style={{fontSize:"13px",color:"#B54708",fontFamily:"Inter,sans-serif"}}>85%</span>
    </div>

    <div style={{height:"8px",background:"#E5E7EB",borderRadius:"4px",overflow:"hidden"}}>
      <div style={{height:"100%",width:"85%",background:"#F59E0B",borderRadius:"4px"}} />
    </div>
  </div>

  <div style={{display:"flex",flexDirection:"column",gap:"6px"}}>
    <div style={{display:"flex",justifyContent:"space-between"}}>
      <span style={{fontSize:"13px",color:"#B42318",fontFamily:"Inter,sans-serif"}}>Failed</span>
      <span style={{fontSize:"13px",color:"#B42318",fontFamily:"Inter,sans-serif"}}>40%</span>
    </div>

    <div style={{height:"8px",background:"#E5E7EB",borderRadius:"4px",overflow:"hidden"}}>
      <div style={{height:"100%",width:"40%",background:"#EF4444",borderRadius:"4px"}} />
    </div>
  </div>
</div>

**Progress** displays a determinate (known value) or indeterminate (loading) progress bar. Semantic color variants communicate the meaning of the progress state.

***

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @araf-ds/core
  ```

  ```bash yarn theme={null}
  yarn add @araf-ds/core
  ```

  ```bash pnpm theme={null}
  pnpm add @araf-ds/core
  ```
</CodeGroup>

***

## Usage

```tsx theme={null}
import { Progress } from "@araf-ds/core"

export default function Example() {
  return <Progress value={60} showLabel />
}
```

***

## Variants

### Default

<div style={{padding:"24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb"}}>
  <div style={{display:"flex",flexDirection:"column",gap:"6px",maxWidth:"320px"}}>
    <div style={{height:"8px",background:"#E5E7EB",borderRadius:"4px",overflow:"hidden"}}>
      <div style={{height:"100%",width:"60%",background:"#0479CE",borderRadius:"4px"}} />
    </div>
  </div>
</div>

```tsx theme={null}
<Progress value={60} />
```

### With Label

<div style={{padding:"24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb"}}>
  <div style={{display:"flex",flexDirection:"column",gap:"6px",maxWidth:"320px"}}>
    <div style={{display:"flex",justifyContent:"space-between"}}>
      <span style={{fontSize:"13px",color:"#667085",fontFamily:"Inter,sans-serif"}}>75% uploaded</span>
    </div>

    <div style={{height:"8px",background:"#E5E7EB",borderRadius:"4px",overflow:"hidden"}}>
      <div style={{height:"100%",width:"75%",background:"#0479CE",borderRadius:"4px"}} />
    </div>
  </div>
</div>

```tsx theme={null}
<Progress value={75} showLabel label="75% uploaded" />
```

### Semantic Variants

<div style={{padding:"24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb"}}>
  <div style={{display:"flex",flexDirection:"column",gap:"12px",maxWidth:"320px"}}>
    <div style={{display:"flex",flexDirection:"column",gap:"4px"}}>
      <span style={{fontSize:"12px",color:"#027A48",fontFamily:"Inter,sans-serif"}}>Complete</span>

      <div style={{height:"8px",background:"#E5E7EB",borderRadius:"4px",overflow:"hidden"}}>
        <div style={{height:"100%",width:"100%",background:"#16A34A",borderRadius:"4px"}} />
      </div>
    </div>

    <div style={{display:"flex",flexDirection:"column",gap:"4px"}}>
      <span style={{fontSize:"12px",color:"#B54708",fontFamily:"Inter,sans-serif"}}>Almost full</span>

      <div style={{height:"8px",background:"#E5E7EB",borderRadius:"4px",overflow:"hidden"}}>
        <div style={{height:"100%",width:"85%",background:"#F59E0B",borderRadius:"4px"}} />
      </div>
    </div>

    <div style={{display:"flex",flexDirection:"column",gap:"4px"}}>
      <span style={{fontSize:"12px",color:"#B42318",fontFamily:"Inter,sans-serif"}}>Failed at 40%</span>

      <div style={{height:"8px",background:"#E5E7EB",borderRadius:"4px",overflow:"hidden"}}>
        <div style={{height:"100%",width:"40%",background:"#EF4444",borderRadius:"4px"}} />
      </div>
    </div>
  </div>
</div>

```tsx theme={null}
<Progress value={100} variant="success" showLabel label="Complete" />
<Progress value={85} variant="warning" showLabel label="Almost full" />
<Progress value={40} variant="error" showLabel label="Failed at 40%" />
```

### Sizes

<div style={{padding:"24px",background:"#f9fafb",borderRadius:"12px",border:"1px solid #e5e7eb"}}>
  <div style={{display:"flex",flexDirection:"column",gap:"12px",maxWidth:"320px"}}>
    <div style={{display:"flex",flexDirection:"column",gap:"4px"}}>
      <span style={{fontSize:"11px",color:"#71717a",fontFamily:"Inter,sans-serif"}}>Small (4px)</span>

      <div style={{height:"4px",background:"#E5E7EB",borderRadius:"2px",overflow:"hidden"}}>
        <div style={{height:"100%",width:"60%",background:"#0479CE",borderRadius:"2px"}} />
      </div>
    </div>

    <div style={{display:"flex",flexDirection:"column",gap:"4px"}}>
      <span style={{fontSize:"11px",color:"#71717a",fontFamily:"Inter,sans-serif"}}>Medium (8px)</span>

      <div style={{height:"8px",background:"#E5E7EB",borderRadius:"4px",overflow:"hidden"}}>
        <div style={{height:"100%",width:"60%",background:"#0479CE",borderRadius:"4px"}} />
      </div>
    </div>

    <div style={{display:"flex",flexDirection:"column",gap:"4px"}}>
      <span style={{fontSize:"11px",color:"#71717a",fontFamily:"Inter,sans-serif"}}>Large (12px)</span>

      <div style={{height:"12px",background:"#E5E7EB",borderRadius:"6px",overflow:"hidden"}}>
        <div style={{height:"100%",width:"60%",background:"#0479CE",borderRadius:"6px"}} />
      </div>
    </div>
  </div>
</div>

```tsx theme={null}
<Progress value={60} size="sm" />
<Progress value={60} size="md" />
<Progress value={60} size="lg" />
```

| Size   | Height | Use case                             |
| ------ | ------ | ------------------------------------ |
| Small  | 4px    | Compact UI, table cells              |
| Medium | 8px    | Default — most contexts              |
| Large  | 12px   | Prominent upload/download indicators |

***

## API Reference

<ParamField path="value" type="number">
  Progress value from 0 to `max`. Omit for indeterminate animation.
</ParamField>

<ParamField path="max" type="number" default="100">
  Maximum value (100 = full).
</ParamField>

<ParamField path="variant" type="string" default="default">
  Semantic fill color. Values: `default` · `success` · `warning` · `error`
</ParamField>

<ParamField path="size" type="string" default="md">
  Bar height. Values: `sm` · `md` · `lg`
</ParamField>

<ParamField path="showLabel" type="boolean" default="false">
  Displays a percentage label above the bar.
</ParamField>

<ParamField path="label" type="string">
  Custom label text. Overrides the auto-generated percentage.
</ParamField>

<ParamField path="className" type="string">
  Additional Tailwind classes for custom overrides.
</ParamField>

***

## Accessibility

* Progress uses `role="progressbar"` with `aria-valuenow`, `aria-valuemin`, and `aria-valuemax`
* Indeterminate state (no `value`) uses `aria-valuenow` omitted per ARIA spec
* Label text is referenced via `aria-label` or `aria-labelledby`
* Color alone does not convey meaning — always pair variant colors with a label
* Do not rely on animation alone for indeterminate state; add an `aria-label` like "Loading"

***

## Do's & Don'ts

<CardGroup cols={2}>
  <Card title="Do" icon="check" iconType="solid" color="#16A34A">
    * Use `variant="success"` when a task completes successfully
    * Use `variant="warning"` for high-usage alerts (storage, quota)
    * Always show a label when the progress value matters to the user
    * Use indeterminate mode when the duration is unknown
  </Card>

  <Card title="Don't" icon="xmark" iconType="solid" color="#DC2626">
    * Don't use color alone to indicate status — always pair with a label
    * Don't use Progress for interactive input — use Slider instead
    * Don't show multiple progress bars for the same task simultaneously
    * Don't display a Progress bar for actions under 300ms — it creates visual noise
  </Card>
</CardGroup>
