--- title: File Upload description: Used to select and upload files from their device. links: source: components/file-upload storybook: components-file-upload--basic recipe: file-upload ark: https://ark-ui.com/react/docs/components/file-upload --- ## Usage ```jsx import { FileUpload } from "@chakra-ui/react" ``` ```jsx ``` ## Shortcuts The `FileUpload` component also provides a set of shortcuts for common use cases. ### FileUploadItems By default, the `FileUploadItems` shortcut renders the list of uploaded files. This works: ```tsx {({ acceptedFiles }) => acceptedFiles.map((file) => ( )) } ``` This might be more concise, if you don't need to customize the file upload items: ```tsx ``` ### FileUploadList The `FileUploadList` shortcut renders the list of uploaded files. It composes the `FileUpload.ItemGroup` and `FileUpload.Items` components. ```tsx ``` is the same as: ```tsx ``` ## Examples ### Accepted Files Define the accepted files for upload using the `accept` prop. ### Multiple Files Upload multiple files at once by using the `maxFiles` prop. ### Custom Preview Here's an example of how to show a custom image preview for files. ### Directory Use the `directory` prop to allow selecting a directory instead of a file. ### Media Capture Use the `capture` prop to select and upload files from different environments and media types. > **Note:** This is > [not fully supported](https://caniuse.com/mdn-api_htmlinputelement_capture) in > all browsers. ### Dropzone Drop multiple files inside the dropzone and use the `maxFiles` prop to set the number of files that can be uploaded at once. ### Input Use the `FileInput` component to create a trigger that looks like a text input. ### Clearable Here's an example of a clearable file upload input. ### Pasting Files Here's an example of handling files pasted from the clipboard. ### Store An alternative way to control the file upload is to use the `RootProvider` component and the `useFileUpload` store hook. This way you can access the file upload state and methods from outside the file upload. ## Props ### Root