# Progress Download Button (https://dimah-s3.vercel.app/docs/react/ui/components/progress-download-button)





`ProgressDownloadButton` streams the download in the browser via fetch, displaying real-time progress percentages with cancel capability.

## Preview [#preview]

<DemoPreview name="progress-download-demo.tsx">
  <ProgressDownloadDemo />
</DemoPreview>

## Install [#install]

Complete [UI setup](https://dimah-s3.vercel.app/docs/react/ui) first — stylesheet and toaster. Then
add this component:

<Tabs items="[&#x22;npm package&#x22;, &#x22;shadcn registry&#x22;]">
  <Tab value="npm package">
    ```tsx
    import { ProgressDownloadButton } from "@dimah-s3/ui";
    ```
  </Tab>

  <Tab value="shadcn registry">
    <CodeBlockTabs defaultValue="npm">
      <CodeBlockTabsList>
        <CodeBlockTabsTrigger value="npm">
          npm
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="pnpm">
          pnpm
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="yarn">
          yarn
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="bun">
          bun
        </CodeBlockTabsTrigger>
      </CodeBlockTabsList>

      <CodeBlockTab value="npm">
        ```bash
        npx shadcn@latest add @dimah-s3/progress-download-button
        ```
      </CodeBlockTab>

      <CodeBlockTab value="pnpm">
        ```bash
        pnpm dlx shadcn@latest add @dimah-s3/progress-download-button
        ```
      </CodeBlockTab>

      <CodeBlockTab value="yarn">
        ```bash
        yarn dlx shadcn@latest add @dimah-s3/progress-download-button
        ```
      </CodeBlockTab>

      <CodeBlockTab value="bun">
        ```bash
        bun x shadcn@latest add @dimah-s3/progress-download-button
        ```
      </CodeBlockTab>
    </CodeBlockTabs>
  </Tab>
</Tabs>

***

## Usage [#usage]

```tsx
"use client";

import { useDownload } from "@dimah-s3/react";
import { ProgressDownloadButton } from "@dimah-s3/ui";

export function DocumentDownloader({ documentKey }: { documentKey: string }) {
  const download = useDownload({ route: "document", mode: "fetch" });

  return <ProgressDownloadButton download={download} objectKey={documentKey} />;
}
```

***

## Props [#props]

```ts
import type { ProgressDownloadButtonProps } from "@dimah-s3/ui";
```

<AutoTypeTable path="packages/ui/src/components/dimah-s3/download/progress-download-button.tsx" name="ProgressDownloadButtonProps" />

## Frequently asked questions [#frequently-asked-questions]

<Accordions>
  <Accordion title="How do I dismiss the status row after download?">
    Completed and failed attachments include a dismiss control that calls `download.reset()`. You can also call `reset()` yourself.
  </Accordion>

  <Accordion title="How does cancellation work?">
    Clicking the button while an active download is in progress immediately aborts the underlying fetch stream and resets the button state.
  </Accordion>

  <Accordion title="Does this work with private buckets?">
    Yes. `useDownload` requests a signed URL before initiating the fetch stream, respecting any route guards or bucket policies.
  </Accordion>
</Accordions>
