Upload - Keep React
Table of Contents#
- Default Upload
- Upload Pending
- Upload Failed
- Upload Success
- Horizontal Upload
- Horizontal Upload Pending
- Horizontal Upload Failed
- Horizontal Upload Success
- Horizontal Disabled Upload
- Upload Disabled
- API Reference
Default Upload#
The Default Upload component enables users to choose and upload a file.The onFileChange callback is used to handle the file selection and update the selected file's name.
Upload Pending#
The progressType prop is set to "pending" to indicate that the progress is pending.
Upload Failed#
The progressType prop is set to "error" to indicate that the progress is failed.
Upload Success#
The progressType prop is set to "success" to indicate that the progress is success.
Horizontal Upload#
The horizontal prop is set to true, allowing for a horizontal layout.
Horizontal Upload Pending#
The progressType="pending" and horizontal={true} props indicate that the horizontal upload progress is pending.
Horizontal Upload Failed#
The progressType="error" and horizontal={true} props indicate that the horizontal upload progress is failed.
Horizontal Upload Success#
The progressType="success" and horizontal={true} props indicate that the horizontal upload progress is success.
Horizontal Disabled Upload#
The horizontal={true} and disabled={true} props indicate that the horizontal upload disabled.
Upload Disabled#
The disabled={true} prop indicate that the upload component is disabled.
API Reference#
Explore the available props for the upload component
| Property | Description | Type | Default |
|---|---|---|---|
| file | The selected file's name or path for display. | string | None |
| horizontal | Arranges the component horizontally if set to true. | boolean | false |
| disabled | Disables interactions with the upload component. | boolean | false |
| showProgressBar | Indicates whether to display a progress bar during file upload. | boolean | false |
| progressType | Sets the visual style of the progress bar based on the upload status. | success error pending | pending |
| progress | The progress percentage of the file upload. | number | 0 |
| uploadTime | Timestamp indicating the time of the upload. | string | 0 |
| onFileChange | Callback function when the selected file changes. | Function | (e:ChangeEvent)=>void |