ComponentsDownload Button

Download Button

Platform-aware download buttons for Mac, Windows and Linux with a smooth hover roll animation and fully swappable colors.

Preview

Installation

  1. 1

    Run the following command

    npx shadcn@latest add https://localhostui.com/r/download-button.json
    

Props

PropTypeDefaultDescription
platform
"mac""windows""linux""custom"
"custom"Selects the default label, icon and download URL from the built-in platform config.
labelReact.ReactNode—Overrides the label text/node. Falls back to the platform's default label.
iconReact.ReactNode—Overrides the icon. Falls back to the platform's default icon.
iconPosition
"left""right"
"left"Side of the label the icon is rendered on.
showIconbooleantrueWhether to render the icon at all.
as
"button""a"
"button"Renders a native <button> or an <a> (needed for direct file downloads).
hrefstring—Download URL, used when as="a". Falls back to the platform's downloadUrl.
fileNamestring—Filename hint passed to the anchor's download attribute.