FileInput

FileInputは、ユーザーがファイルを選択するために使用されるコンポーネントです。

Please upload file

使い方

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

バリアントを変更する

Outline
Filled
Flushed

サイズを変更する

Xs
Sm
Md
Lg
Xl

カラースキームを変更する

Success
Warning

複数選択を許容する

複数選択を許容する場合は、multipletrueに設定します。

multiple

拡張子を指定する

拡張子を指定する場合は、acceptに文字列(タイプ)を設定します。

only png, jpeg

区切りをカスタマイズする

区切りをカスタマイズする場合は、separatorに文字列を設定します。

Please upload file

カスタムコンポーネントを使う

カスタムコンポーネントを使う場合は、componentReactNodeを設定します。componentは、value(File)とindexを提供します。

Please upload file

ファイル名を整形する

ファイル名を整形する場合は、formatを使用します。formatは、Fileを提供します。

Please upload file

子要素をカスタマイズする

子要素をカスタマイズする場合は、childrenを使用します。childrenは、Fileを配列で提供します。

アドオンを追加する

アドオンを追加する場合は、FileInputInputGroup.Rootでラッピングし、InputGroup.Addonを使用します。

Please upload file

要素を追加する

要素を追加する場合は、FileInputInputGroup.Rootでラッピングし、InputGroup.Elementを使用します。

Please upload file

無効にする

無効にする場合は、disabledtrueに設定します。

Please upload file
Please upload file
Please upload file

読み取り専用にする

読み取り専用にする場合は、readOnlytrueに設定します。

Please upload file
Please upload file
Please upload file

無効な入力にする

無効な入力にする場合は、invalidtrueに設定します。

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

ボーダーの色を変更する

ボーダーの色を変更する場合は、focusBorderColorまたはerrorBorderColorに値を設定します。

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

リセットする

値をリセットする場合は、resetRefrefを設定します。設定されたrefにコールバック関数が付与されるので、それを実行します。

files: 0

placeholder

Props

アクセシビリティ

現在、v2の移行に伴い、このセクションは更新中です。