Download Button
Platform-aware download buttons for Mac, Windows and Linux with a smooth hover roll animation and fully swappable colors.
Preview
Installation
- 1
Run the following command
npx shadcn@latest add https://localhostui.com/r/download-button.json
Props
| Prop | Type | Default | Description |
|---|---|---|---|
platform | "mac""windows""linux""custom" | "custom" | Selects the default label, icon and download URL from the built-in platform config. |
label | React.ReactNode | — | Overrides the label text/node. Falls back to the platform's default label. |
icon | React.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. |
showIcon | boolean | true | Whether to render the icon at all. |
as | "button""a" | "button" | Renders a native <button> or an <a> (needed for direct file downloads). |
href | string | — | Download URL, used when as="a". Falls back to the platform's downloadUrl. |
fileName | string | — | Filename hint passed to the anchor's download attribute. |