Skip to main content

UploadButton

A styled file-picker button. Wraps the browser file input in a consistent MUI Button appearance and exposes the selected files via a callback.

πŸ“– Storybook

Preview​

Import​

import { UploadButton } from "@xocialive/ui-components";

Basic usage​

<UploadButton accept="image/*,application/pdf" onFilesSelected={(files) => handleUpload(files)}>
Upload document
</UploadButton>

Props​

PropTypeDefaultDescription
onFilesSelected(files: FileList) => voidβ€”Called when the user picks files
acceptstring"*"MIME types / file extensions passed to <input accept>
multiplebooleanfalseAllow picking multiple files
disabledbooleanfalseDisables the button
childrenReactNode"Upload"Button label
sxSxProps<Theme>β€”Root element style overrides