4.2.7 • Published 2 months ago

@highlight-ui/file-management v4.2.7

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

npm personio.design storybook.personio.design

@highlight-ui/file-management

Installation

Using npm:

npm install @highlight-ui/file-management

Using yarn:

yarn add @highlight-ui/file-management

Using pnpm:

pnpm install @highlight-ui/file-management

In your (S)CSS file:

@import url('@highlight-ui/file-management');

Once the package is installed, you can import the library:

import { FileUploader, FileList } from '@highlight-ui/file-management';

Usage

import React, { useState } from 'react';
import { FileUploader, FileList } from '@highlight-ui/file-management';

export default function FileManagementExample() {
  return (
    <>
      <FileUploader
        disabled={false}
        description="Drag and drop files here or click to upload"
        maxFileSize={20840}
        onDrop={handleDrop}
        onDragOverText="Drop here!"
        showIcon
        title="Primary text"
        image="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAoCAYAAABXRRJPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAVSSURBVHgB7VhbTCNVGP6nF6il7EyRW7HQ4Q4LhVm5hIuRJsSoUeM2PK36sNEnTXzkwRgN2RfxQdf4SEwkPviwWSOo8XGtGldEIGVBlO4uHYgWdrO47bZAodMZzz+2TYfOwCoYJxu+ZDLn/Gdy5nznP//tAJxAH6AOGuzp6WEFQWC1xmdmZnygA5i0Brq6urhV7+sXhYfL+aTZwtVbBfKxGLYKuzyOLy/dmHeXu5iFrz6bgGOEx+OBeDzOJhIJrr+/31VWVsYlk0lucnJyXJKkiCiKYfKZz+/3hw8lceuJl863P9bpGXOswPr6umKs0GaFWwP98MKnpX74FySyF0q6DEVRXG1trctisXBut5utqKgAm80GhYWF8veNjY3Q2to64vV6wysrK8GhoSGeiP2HkpDyLEyVRYRYdAfWNzaVg+UAtEMESkywnZ2dHq05yK6xZIF0srCouvl0Ez3Q1sLSNM0WFxczdrud2b/Yg4DfI+GamhqXwWDg7osE4us7+VDlbABoagDaJEE0tgP5G0HgN7ZgLbgILqOBKT/36se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gM+xUt6jKVUlgocTMXZkHnSHW3KUq17woeCj4C8YKXdUXCboURIs1R65JAs+b+d4dXdUXxA1JW3XtORureXmG0bvr/dfaV8+PjAgFtJcit9GkhGUUbwz7ohghwYWGo0PKtFJzUoIg1zeUJN6lxGTYFNu8Vrj4o5iE/dwOAGaJ5KaaAZ1hamqKhxOc4AQPNv4CL98fSS/xcLcAAAAASUVORK5CYII="
      />
      <FileList files={files} />
    </>
  );
}

Props 📜

FileUploader

PropTypeRequiredDefaultDescription
descriptionstringYesAllows providing the description message which is shown on the uploader
onDragOverTextstringYesAllows providing a text to be shown when dragging over the uploader
onDrop(acceptedFiles: File[], rejectedFiles: FileRejection[]) => voidYesAllows providing a callback for when drop event occurs
acceptstringNoAllows providing a list of supported file extensions
multiplebooleanNotrueAllows user to select multiple files or restrict it to only single file
classNamestringNoAllows providing a custom class name
disabledbooleanNofalseAllows disabling the uploader
imagestringNoAllows providing an image for the uploader, this value will be passed to src attribute of the image tag
maxFileSizenumberNoAllows providing the maximum file size supported by the uploader
showIconbooleanNotrueAllows showing or hiding the image
titlestringNoAllows providing a title to be shown for the uploader
onDragEnter() => voidNoAllows providing a callback for when dragenter event occurs
onDragLeave() => voidNoAllows providing a callback for when dragleave event occurs
onDragOver() => voidNoAllows providing a callback for when dragover event occurs

FileList

PropTypeRequiredDefaultDescription
filesFileListItem[]YesA list of files. See FileListItem definition below.
classNamestringNoAllows providing a custom class name
onDelete(id) => voidNoAllows providing a callback for when deleting a file
variant'default', 'selectable'NodefaultThe FileList variant. When selectable, users can provide addition props selectedItems and onSelect

FileListItem

PropTypeRequiredDefaultDescription
idstringYesList item unique id
filenamestringYesList item file name
canDeletebooleanNofalseCan this item be deleted
downloadUrlstringNoThe download url of the list item
previewUrlstringNoThe preview url of the list item
validationStatus"valid", "validating", "invalid", "warning"NoThe validation status of the list item
validationMessagestringNoThe validation message of the list item

Contributing 🖌️

Please visit personio.design for usage guidelines and visual examples.

If you're interested in contributing, please visit our contribution page.

4.2.7

2 months ago

4.2.6

3 months ago

4.2.5

5 months ago

4.2.4

5 months ago

4.2.3

5 months ago

4.1.8

9 months ago

4.1.7

9 months ago

4.1.9

9 months ago

4.1.20

7 months ago

4.1.21

7 months ago

4.0.7

10 months ago

4.1.22

7 months ago

4.0.6

10 months ago

4.0.9

10 months ago

4.0.8

10 months ago

4.2.2

7 months ago

4.0.10

10 months ago

4.2.1

7 months ago

4.2.0

7 months ago

4.0.16

10 months ago

4.0.15

10 months ago

4.0.12

10 months ago

4.0.11

10 months ago

4.0.14

10 months ago

4.0.13

10 months ago

4.1.10

9 months ago

4.1.11

9 months ago

4.1.16

8 months ago

4.1.17

8 months ago

4.1.18

8 months ago

4.1.19

7 months ago

4.1.12

9 months ago

4.1.13

9 months ago

4.1.14

8 months ago

4.1.15

8 months ago

4.1.4

10 months ago

4.1.3

10 months ago

4.1.6

9 months ago

4.1.5

9 months ago

4.1.0

10 months ago

4.1.2

10 months ago

4.1.1

10 months ago

4.2.0-r18.0

8 months ago

4.0.5

11 months ago

4.0.4

11 months ago

4.0.1

11 months ago

4.0.0

11 months ago

4.0.3

11 months ago

4.0.2

11 months ago

3.0.0

11 months ago

2.5.29

12 months ago

2.5.27

12 months ago

2.5.28

12 months ago

2.5.32

11 months ago

2.5.30

12 months ago

2.5.31

12 months ago

2.5.18

1 year ago

2.5.19

1 year ago

2.5.16

1 year ago

2.5.17

1 year ago

2.5.25

1 year ago

2.5.26

1 year ago

2.5.21

1 year ago

2.5.22

1 year ago

2.5.23

1 year ago

2.5.24

1 year ago

2.5.20

1 year ago

2.5.9

1 year ago

2.5.14

1 year ago

2.5.15

1 year ago

2.5.10

1 year ago

2.5.11

1 year ago

2.5.12

1 year ago

2.5.13

1 year ago

2.4.1

1 year ago

2.4.0

1 year ago

2.4.2

1 year ago

2.0.34

1 year ago

2.0.32

2 years ago

2.5.6

1 year ago

2.5.5

1 year ago

2.5.8

1 year ago

2.5.7

1 year ago

2.3.0

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.4

1 year ago

2.3.3

1 year ago

2.3.6

1 year ago

2.3.5

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.2.4

1 year ago

2.3.8

1 year ago

2.3.7

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

2.5.0

1 year ago

2.1.4

1 year ago

2.1.3

1 year ago

2.5.2

1 year ago

2.1.6

1 year ago

2.5.1

1 year ago

2.1.5

1 year ago

2.5.4

1 year ago

2.5.3

1 year ago

2.1.0

1 year ago

2.0.28

2 years ago

2.0.29

2 years ago

2.0.31

2 years ago

2.0.26

2 years ago

2.0.27

2 years ago

2.0.24

2 years ago

2.0.25

2 years ago

2.0.22

2 years ago

2.0.23

2 years ago

2.0.16

2 years ago

2.0.19

2 years ago

2.0.17

2 years ago

2.0.18

2 years ago

2.0.20

2 years ago

2.0.21

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.0-alpha.1

2 years ago

2.0.8

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.0.15

2 years ago

2.0.13

2 years ago

2.0.14

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

2.0.0-alpha.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.1

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.0

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.19

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.23

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.2

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago