FileInput

FileInput is a component used for users to select files.

Please upload file

Usage

import { FileInput } from "@yamada-ui/react"
<FileInput />

Change Variant

Outline
Filled
Flushed

Change Size

Xs
Sm
Md
Lg
Xl

Change Color Scheme

Success
Warning

Allow Multiple Selection

To allow multiple selection, set multiple to true.

multiple

Specify File Extensions

To specify file extensions, set accept to a string(type).

only png, jpeg

Customize Separator

To customize the separator, set separator to a string.

Please upload file

Use Custom Component

To use a custom component, set component to a ReactNode. component provides value(File) and index.

Please upload file

Format File Names

To format file names, use format. format provides File.

Please upload file

Customize Children

To customize children, use children. children provides File as an array.

Add Addon

To add an addon, wrap FileInput with InputGroup.Root and use InputGroup.Addon.

Please upload file

Add Element

To add an element, wrap FileInput with InputGroup.Root and use InputGroup.Element.

Please upload file

Disable

To disable, set disabled to true.

Please upload file
Please upload file
Please upload file

Read-Only

To make it read-only, set readOnly to true.

Please upload file
Please upload file
Please upload file

Invalid

To make the input invalid, set invalid to true.

Please upload file
Please upload file
Please upload file
File is required.

Change Border Color

To change the border color, set a color to focusBorderColor or errorBorderColor.

Custom focus border color
Custom focus border color
Custom error border color
Custom error border color

Reset

To reset the value, set resetRef to ref. A callback function will be attached to the set ref, execute it.

files: 0

placeholder

Props

Accessibility

Currently, this section is being updated due to the migration of v2.