Back to Mantine

File Button

apps/mantine.dev/src/pages/core/file-button.mdx

9.3.2621 B
Original Source

import { FileButtonDemos } from '@docs/demos'; import { Layout } from '@/layout'; import { MDX_DATA } from '@/mdx';

export default Layout(MDX_DATA.FileButton);

Usage

<Demo data={FileButtonDemos.usage} />

Multiple files

Set the multiple prop to allow picking multiple files:

<Demo data={FileButtonDemos.multiple} />

Reset file

resetRef should be used to fix the issue with stale value on the hidden input element as input type file cannot be controlled. Call resetRef when the user selection is cleared:

<Demo data={FileButtonDemos.reset} /> <ServerComponentsIncompatible component="FileButton" />