Upload components
Any upload field#
The AnyUploadField component renders a file upload field for uploading any file.
- Component - simple
- Component - advanced
- API schema
This advanced upload field is a bit more complex than the Simple component. It has a label, a description, a file name, a file size, a file type, a width and a height. It also has a custom accept mime types.
Props#
| Prop | Description |
|---|---|
| string The name of the column in Contember schema where to store file url. Required |
| ReactNode The label for the field. Required |
| ReactNode The description for the field. |
| undefined | string The name of the column in Contember schema where to store file name. |
| undefined | string The name of the column in Contember schema where to store file size. |
| undefined | string The name of the column in Contember schema where to store file type. |
| undefined | boolean = true If true, the field allows adding new options. |
| undefined | ((options: AcceptFileOptions) => boolean | Promise A function that is called to check if the file is accepted. |
| undefined | string | string[] Accepted mime types. |
Audio upload field#
The AudioUploadField component renders a file upload field for uploading audio files.
- Component - simple
- Component - advanced
- API schema
Props#
| Prop | Description |
|---|---|
| string The name of the column in Contember schema where to store file url. Required |
| ReactNode The label for the field. Required |
| ReactNode The description for the field. |
| undefined | string The name of the column in Contember schema where to store file name. |
| undefined | string The name of the column in Contember schema where to store file size. |
| undefined | string The name of the column in Contember schema where to store file type. |
| undefined | boolean = true If true, the field allows adding new options. |
| undefined | ((options: AcceptFileOptions) => boolean | Promise A function that is called to check if the file is accepted. |
| undefined | string | string[] Accepted mime types. |
Image upload field#
The ImageUploadField component renders a file upload field for uploading image files.
Props#
| Prop | Description |
|---|---|
| string The name of the column in Contember schema where to store file url. Required |
| ReactNode The label for the field. Required |
| ReactNode The description for the field. |
| undefined | string The name of the column in Contember schema where to store file name. |
| undefined | string The name of the column in Contember schema where to store file size. |
| undefined | string The name of the column in Contember schema where to store file type. |
| undefined | string The name of the column in Contember schema where to store height. |
| undefined | string The name of the column in Contember schema where to store width. |
| undefined | boolean = true If true, the field allows adding new options. |
| undefined | ((options: AcceptFileOptions) => boolean | Promise A function that is called to check if the file is accepted. |
| undefined | string | string[] Accepted mime types. |
| (options: RenderFilePreviewOptions Renders the file preview. |
Video upload field#
The VideoUploadField component renders a file upload field for uploading video files.
Props#
| Prop | Description |
|---|---|
| string The name of the column in Contember schema where to store file url. Required |
| ReactNode The label for the field. Required |
| ReactNode The description for the field. |
| undefined | string The name of the column in Contember schema where to store file name. |
| undefined | string The name of the column in Contember schema where to store file size. |
| undefined | string The name of the column in Contember schema where to store file type. |
| undefined | string The name of the column in Contember schema where to store height. |
| undefined | string The name of the column in Contember schema where to store width. |
| undefined | boolean = true If true, the field allows adding new options. |
| undefined | ((options: AcceptFileOptions) => boolean | Promise A function that is called to check if the file is accepted. |
| undefined | string | string[] Accepted mime types. |
Any file repeater#
The AnyFileRepeater component renders a repeater field for uploading any file.
Audio file repeater#
The AudioFileRepeater component renders a file repeater field for uploading audio files.
- Component - simple
- Component - advanced
- API schema
Props#
| Prop | Description |
|---|---|
| string The name of the column in Contember schema where to store data. Required |
| string The name of the column in Contember schema where to store file url. Required |
| ReactNode The label for the field. Required |
| undefined | string The name of the column in Contember schema that is used to sort the options. |
| undefined | string The name of the column in Contember schema that is used to order the options. |
| ReactNode The description for the field. |
| undefined | string The name of the column in Contember schema where to store file name. |
| undefined | string The name of the column in Contember schema where to store file size. |
| undefined | string The name of the column in Contember schema where to store file type. |
| undefined | string The name of the column in Contember schema where to store height. |
| undefined | string The name of the column in Contember schema where to store width. |
| undefined | boolean = true If true, the field allows adding new options. |
| undefined | ((options: AcceptFileOptions) => boolean | Promise A function that is called to check if the file is accepted. |
| undefined | string | string[] Accepted mime types. |
Image file repeater#
The ImageFileRepeater component renders a file repeater for uploading image files.
- Component - simple
- Component - advanced
- API schema
Props#
| Prop | Description |
|---|---|
| string The name of the column in Contember schema where to store data. Required |
| string The name of the column in Contember schema where to store file url. Required |
| ReactNode The label for the field. Required |
| undefined | string The name of the column in Contember schema that is used to sort the options. |
| undefined | string The name of the column in Contember schema that is used to order the options. |
| ReactNode The description for the field. |
| undefined | string The name of the column in Contember schema where to store file name. |
| undefined | string The name of the column in Contember schema where to store file size. |
| undefined | string The name of the column in Contember schema where to store file type. |
| undefined | string The name of the column in Contember schema where to store height. |
| undefined | string The name of the column in Contember schema where to store width. |
| undefined | boolean = true If true, the field allows adding new options. |
| undefined | ((options: AcceptFileOptions) => boolean | Promise A function that is called to check if the file is accepted. |
| undefined | string | string[] Accepted mime types. |
Video file repeater#
The VideoFileRepeater component renders a file repeater for uploading video files.
- Component - simple
- Component - advanced
- API schema
Props#
| Prop | Description |
|---|---|
| string The name of the column in Contember schema where to store data. Required |
| string The name of the column in Contember schema where to store file url. Required |
| ReactNode The label for the field. Required |
| undefined | string The name of the column in Contember schema that is used to sort the options. |
| undefined | string The name of the column in Contember schema that is used to order the options. |
| ReactNode The description for the field. |
| undefined | string The name of the column in Contember schema where to store file name. |
| undefined | string The name of the column in Contember schema where to store file size. |
| undefined | string The name of the column in Contember schema where to store file type. |
| undefined | boolean = true If true, the field allows adding new options. |
| undefined | ((options: AcceptFileOptions) => boolean | Promise A function that is called to check if the file is accepted. |
| undefined | string | string[] Accepted mime types. |