File Uploader
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.
FileUploader
import { FileUploader } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
buttonText | string | undefined | "Upload from Device" | — |
acceptImages | boolean | undefined | true | — |
acceptVideos | boolean | undefined | true | — |
acceptAudio | boolean | undefined | false | — |
maxFileSize | number | undefined | 0 | Maximum original file size in bytes; 0 means unlimited. |
dropzone | boolean | undefined | false | Show a drag/drop target while retaining the accessible picker button. |
disabled | boolean | undefined | false | — |
multiple | boolean | undefined | false | — |
buttonClass | string | undefined | — | Class for the trigger button. When set it REPLACES the default styling — pass the host's button class (e.g. primaryButton) so the uploader matches the surrounding buttons instead of the package's shadcn-token default (which doesn't resolve outside the package). |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
file-selected | [payload: FileSelectedPayload] | — | — |
file-cleared | [] | — | — |
upload-error | [message: string] | — | — |
upload-started | [] | — | — |
upload-cancelled | [] | — | — |
Exposed methods and values
| Name | Type | Required / default | Description |
|---|---|---|---|
clearFile | () => 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 FileUploader from './FileUploader.vue'
{
args: {
buttonText: 'Upload from Device',
acceptImages: true,
acceptVideos: true,
multiple: false,
},
}
ImagesOnly
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import FileUploader from './FileUploader.vue'
{
args: {
buttonText: 'Upload Image',
acceptImages: true,
acceptVideos: false,
multiple: false,
},
}
VideosOnly
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import FileUploader from './FileUploader.vue'
{
args: {
buttonText: 'Upload Video',
acceptImages: false,
acceptVideos: true,
multiple: false,
},
}