Skip to content
MultimediaInteractive playground

FileUpload

File selection and transfers with progress.

Preparing the playground…
Text and Markdown example
FileUpload · Example
1function Example() { 2 const [controller] = useState(() => new UploadController({ 3 endpoint: "/api/uploads", 4 autoStart: false 5 })); 6 useEffect(() => () => { void controller.dispose(); }, [controller]); 7 return <div><Toaster /><FileUpload variant="advanced" controller={controller} locale="en" /><p style={{fontSize:12,marginTop:16}}>Select, edit and remove files locally. To upload them, connect a Tus endpoint at /api/uploads.</p></div>; 8}
Read documentation in Markdown

How to use it

Create a stable UploadController and release its resources on unmount. Simple mode supports custom transport; advanced uses a Tus endpoint and confirms uploads from the dashboard.

Opening the modal and selecting, editing or removing files do not require a server. Advanced mode does not support createTask: it uses Tus transport and starts transfers only when Upload is pressed. /api/uploads is an example path, not a configured server. Remote sources require Companion and its server credentials.

Import

React / Next.js
1import { FileUpload, FileUploadStatus } from "@kivora/nextjs";

Interactive examples run inside a component with "use client". The playground's Copy button includes the imports needed for the current example.

API reference 0.2.0

Types from the installed published version, including component properties and common HTML attributes. “Optional” does not imply a default value; omitting a property lets the component decide.

PropertyTypeDescription
controllerRequiredUploadControllerStable instance managing the session and its resources.
acceptstringAccepted file types.
camerabooleanEnable supported camera sources.
dashboardUploadDashboardOptionsConfigure advanced dashboard sources and options.
localestringLocalization in the format expected by the component.
messagesPartial<{ uploadedFiles: string; startUpload: string; remove: string; clearAll: string; reviewHint: string; grid: string; list: string; retry: string; edit: string; addMore: string; choose: string; title: string; sources: string; files: string; camera: string; hint: string; drop: string; back: string; close: string; open: string; loading: string; cancel: string; photo: string; cameraPreview: string; cameraError: string; captureError: string; selectionError: string; ready: string; uploading: string; paused: string; success: string; error: string; canceled: string; upload: string; dismiss: string; preview: string; }>Localized messages replacing the defaults.
showStatusbooleanShow built-in upload status.
sourcesFileUploadSource[]Configures sources. The type describes the supported values and structure.
variant"simple" | "advanced"Visual variant. Use a value supported by this component.

Subcomponents and composition

Review each component's properties and published declaration. Native and accessibility attributes are inherited from the element specified by its type.

FileUpload9 properties
FileUpload · TypeScript
1declare function FileUpload(props: FileUploadProps): React.JSX.Element;
FileUploadStatus3 properties
PropertyTypeDescription
controllerRequiredUploadControllerStable instance managing the session and its resources.
localestringLocalization in the format expected by the component.
messagesPartial<{ uploadedFiles: string; startUpload: string; remove: string; clearAll: string; reviewHint: string; grid: string; list: string; retry: string; edit: string; addMore: string; choose: string; title: string; sources: string; files: string; camera: string; hint: string; drop: string; back: string; close: string; open: string; loading: string; cancel: string; photo: string; cameraPreview: string; cameraError: string; captureError: string; selectionError: string; ready: string; uploading: string; paused: string; success: string; error: string; canceled: string; upload: string; dismiss: string; preview: string; }>Localized messages replacing the defaults.
FileUploadStatus · TypeScript
1declare function FileUploadStatus({ controller, locale, messages }: { 2 controller: UploadController; 3} & UploadLocaleOptions): null;
API generated from @kivora/nextjs 0.2.0View package