@app-studio/components
Upload
A versatile file upload component with support for images, videos, and files, featuring drag-and-drop, preview, progress tracking, and validation.
View component sourceImport
ts
import { Uploader } from '@app-studio/components';New to the library? Complete installation and provider setup first.
Interactive examples
Try the component, then open Code to copy the complete example.
import React from 'react';
import { Vertical } from 'app-studio';
import { Uploader } from '@app-studio/components';
export const DefaultUploader = () => (
<Vertical gap={12} width="100%">
<Uploader
text="Tap to choose a file"
onFileSelect={(file) => console.log('selected', file?.name)}
/>
</Vertical>
);Props
Required props are marked below. A dash indicates an unspecified default. Design system configuration can override implementation defaults.
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
accept | string | '*/*' | See the type and source declaration for this property.Source |
maxSize | number | — | See the type and source declaration for this property.Source |
onFileSelect | ((file: File) => void) | — | See the type and source declaration for this property.Source |
onMultipleFileSelect | ((files: File[]) => void) | — | See the type and source declaration for this property.Source |
validateFile | ((file: File) => string | null) | — | See the type and source declaration for this property.Source |
onError | ((error: string) => void) | — | See the type and source declaration for this property.Source |
thumbnail | string | — | See the type and source declaration for this property.Source |
multiple | boolean | false | See the type and source declaration for this property.Source |
containerProps | ViewProps | — | See the type and source declaration for this property.Source |
errorMessageProps | TextProps | — | See the type and source declaration for this property.Source |
progressProps | ViewProps | — | See the type and source declaration for this property.Source |
videoProps | ViewProps | — | See the type and source declaration for this property.Source |
imageProps | ImageProps | — | See the type and source declaration for this property.Source |
iconProps | IconProps | — | See the type and source declaration for this property.Source |
textProps | TextProps | — | See the type and source declaration for this property.Source |
renderVideo | ((props: any) => React.ReactNode) | — | See the type and source declaration for this property.Source |
renderText | ((props: any) => React.ReactNode) | — | See the type and source declaration for this property.Source |
renderImage | ((props: any) => React.ReactNode) | — | See the type and source declaration for this property.Source |
renderError | ((props: any) => React.ReactNode) | — | See the type and source declaration for this property.Source |
renderFile | ((props: any) => React.ReactNode) | — | See the type and source declaration for this property.Source |
renderProgress | ((props: any) => React.ReactNode) | — | See the type and source declaration for this property.Source |
previewUrl | string | null | — | See the type and source declaration for this property.Source |
thumbnailUrl | string | null | — | See the type and source declaration for this property.Source |
errorMessage | string | null | — | See the type and source declaration for this property.Source |
isLoading | boolean | false | Displays the loading state.Source |
icon | View typestring | number | bigint | boolean | import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").ReactElement<unknown, string | import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").JSXElementConstructor<any>> | Iterable<import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").ReactNode> | import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").ReactPortal | Promise<string | number | bigint | boolean | import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").ReactPortal | import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").ReactElement<unknown, string | import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").JSXElementConstructor<any>> | Iterable<import("/Volumes/workspace/open-source/app-studio-components/node_modules/@types/react/index").ReactNode> | null | undefined> | null | — | Icon rendered alongside the content.Source |
text | string | — | See the type and source declaration for this property.Source |
progress | number | 0 | See the type and source declaration for this property.Source |
fileType | "video" | "image" | "file""video""image""file" | — | See the type and source declaration for this property.Source |
handleClick | (() => void) | — | See the type and source declaration for this property.Source |
views | { container?: ViewProps; view?: ViewProps; image?: ImageProps; horizontal?: ViewProps; text?: ViewProps; } | — | Style overrides for the named internal parts.Source |
For shared layout, color, and responsive properties, read Styling & composition and Responsive layouts. Additional native element attributes depend on the target platform.
Usage guidance
- Give controls a visible label or an accessible name, and verify keyboard interaction. See Accessibility.
- For controlled inputs, update the value from the callback shown in the props table. Keep application state in your component or form library.
- These previews run in the browser. Check React Native setup for platform requirements and differences.