195 Pro components and page blocks

Get Pro

Updated

Download Button

New

Preview

Customize

Duration2.8s
Reset after3.0s
Success colour
Medium

Installation

npx shadcn@latest add https://uibrik.com/r/download-button.json
Adds the files to components/uibrik/download-button and installs @number-flow/react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/download-button.

Usage

import { DownloadButton } from "@/components/uibrik/download-button/download-button";​<DownloadButton  label="Download"  doneLabel="Open"  duration={2.8}  resetAfter={3}  successColor="#16a34a"  size="md"  onDownload={() => {}}  onCancel={() => {}}  onOpen={() => {}}  // progress={0}/>

Where to use Download Button

  • Exports and reports

    Progress lives inside the button, so an export never needs a separate bar or toast.

    Pairs with Data Table

  • Invoices and receipts

    The finished state turns into Open, the next thing people want to do.

    Pairs with Billing Page

  • App and asset downloads

    Pass real progress from 0 to 1, or let it simulate one for a marketing page.

    Pairs with File Card

Props

DownloadButton
label
Type string
"Download"
Label at rest.
doneLabel
Type string
"Open"
Shown once the download finishes.
duration
Type number
2.8
How long a simulated download takes.
resetAfter
Type number
3
How long the finished state shows. 0 keeps it.
successColor
Type string
"#16a34a"
Colour of the check once done.
size
Type "sm" | "md" | "lg"
"md"
Height, padding and text size.
progress
Type number
–
Real progress from 0 to 1. Leave out to simulate.
onDownload
Type () => void
–
Called when pressed at rest.
onCancel
Type () => void
–
Called when a download in flight is pressed again.
onOpen
Type () => void
–
Called when the finished button is pressed.
className
Type string
–
Classes for the button.