Skip to content

File picker API

import { UNSTABLE_FilePicker } from '@cimpress-ui/react';

File picker can integrate with native HTML forms. See our forms guide to learn how to work with forms.

Ref<HTMLDivElement>

The ref type for this component.

UNSTABLE_FilePickerProps
boolean

Whether the field is disabled.

boolean

Whether the field is required.

boolean

Whether the field is invalid.

string[]

The allowed file types that can be selected.

boolean

Whether multiple files can be selected.

(files: File[] | null) => void

Handler called when files are selected.

string

The element's unique identifier. See MDN.

boolean

Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.

string

Sets the CSS className for the element. Only use as a last resort. Use style props instead.

See styling guide.

CSSProperties

Sets the CSS style for the element. Only use as a last resort. Use style props instead.

See styling guide.

string

The content to display as the label.

string

Identifies the element (or elements) that labels the current element.

string

Identifies the element (or elements) that describes the object.

string

Identifies the element (or elements) that provide a detailed, extended description for the object.

string

The <form> element to associate the input with. The value of this attribute must be the id of a <form> in the same document. See MDN.

string

The name of the input element, used when submitting an HTML form. See MDN.

string

A description for the field. Provides a hint such as specific requirements for what to choose.

FieldError

An error message for the field.

(value: File[]) => string | true | string[] | undefined

A function that returns an error message (or true) if a given value is invalid. Validation errors are displayed to the user when the form is submitted. For real-time validation, use the error prop instead.

'user' | 'environment'

Specifies the use of a media capture mechanism to capture the media on the spot.

boolean

Enables the selection of directories instead of individual files.

StyleProps
Responsive<Spacing | "auto">

The amount of margin applied to all edges of this component.

Responsive<Spacing | "auto">

The amount of margin applied to the left and right edges of this component. Takes priority over margin.

Responsive<Spacing | "auto">

The amount of margin applied to the top and bottom edges of this component. Takes priority over margin.

Responsive<Spacing | "auto">

The amount of margin applied to the top edge of this component. Takes priority over marginY and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the right edge of this component. Takes priority over marginX and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the bottom edge of this component. Takes priority over marginY and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the left edge of this component. Takes priority over marginX and margin.