MindeesUI
ComponentsForms

FilePicker

A button that opens the system document picker and returns typed file metadata, gated on expo-document-picker.

FilePicker is a Button that launches the OS document picker and reports the chosen files through onPick as a typed PickedFile[] (empty when cancelled). It is a gated peer: without expo-document-picker installed it renders a MissingPeer fallback showing the install command instead of throwing.

Import

import { FilePicker } from '@mindees/ui';

Usage

<FilePicker onPick={(files) => setFiles(files)} multiple type="application/pdf">
  Upload PDFs
</FilePicker>

Props

PropTypeDefaultDescription
onPick(files: readonly PickedFile[]) => voidFired with the picked files; empty array on cancel.
multiplebooleanfalseAllow selecting more than one file.
typestring | readonly string[]Restrict selectable MIME type(s).
copyToCacheDirectorybooleantrueCopy the picked file into the app cache directory.
childrenReactNode'Choose file'Trigger label.

Also accepts ButtonBaseProps minus onPress and children, so variant, size, and tone apply to the trigger.

Accessibility

When the peer is present, the trigger is a standard Button and inherits its accessibility. When expo-document-picker is missing, a MissingPeer block explains the requirement and the pnpm add expo-document-picker install command.

On this page