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.
Previewβ
Live previewβ Open in Storybook
Importβ
import { UploadButton } from "@xocialive/ui-components";
Basic usageβ
<UploadButton accept="image/*,application/pdf" onFilesSelected={(files) => handleUpload(files)}>
Upload document
</UploadButton>
Propsβ
| Prop | Type | Default | Description |
|---|---|---|---|
onFilesSelected | (files: FileList) => void | β | Called when the user picks files |
accept | string | "*" | MIME types / file extensions passed to <input accept> |
multiple | boolean | false | Allow picking multiple files |
disabled | boolean | false | Disables the button |
children | ReactNode | "Upload" | Button label |
sx | SxProps<Theme> | β | Root element style overrides |