Download Button
Generated from public Vue/TypeScript exports by
pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commitfc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.
DownloadButton
import { DownloadButton } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
url | string | Required | — |
filename | string | undefined | "download" | — |
mimeType | string | undefined | "" | — |
mediaType | string | undefined | "file" | — |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
download-start | [] | — | — |
download-complete | [filename: string] | — | — |
download-error | [error: Error] | — | — |
Exposed methods and values
| Name | Type | Required / default | Description |
|---|---|---|---|
isDownloading | boolean | — | — |
handleDownload | () => Promise<void> | — | — |
Examples
These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import DownloadButton from './DownloadButton.vue'
{
args: {
url: 'https://via.placeholder.com/300',
filename: 'placeholder',
mimeType: 'image/png',
mediaType: 'image',
},
render: (args) => ({
components: { DownloadButton },
setup() {
return { args }
},
template: '<div class="flex items-center gap-4 p-8 bg-slate-700 rounded-lg"><DownloadButton v-bind="args" /></div>',
}),
}
VideoDownload
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import DownloadButton from './DownloadButton.vue'
{
args: {
url: 'https://example.com/sample.mp4',
filename: 'sample-video',
mimeType: 'video/mp4',
mediaType: 'video',
},
render: (args) => ({
components: { DownloadButton },
setup() {
return { args }
},
template: '<div class="flex items-center gap-4 p-8 bg-slate-700 rounded-lg"><DownloadButton v-bind="args" /></div>',
}),
}
AudioDownload
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import DownloadButton from './DownloadButton.vue'
{
args: {
url: 'https://example.com/sample.mp3',
filename: 'podcast-episode',
mimeType: 'audio/mpeg',
mediaType: 'audio',
},
render: (args) => ({
components: { DownloadButton },
setup() {
return { args }
},
template: '<div class="flex items-center gap-4 p-8 bg-slate-700 rounded-lg"><DownloadButton v-bind="args" /></div>',
}),
}