@metamask/snaps-sdk
Version:
A library containing the core functionality for building MetaMask Snaps
29 lines • 1.24 kB
JavaScript
import { createSnapComponent } from "../../component.mjs";
const TYPE = 'FileInput';
/**
* A file input component, which is used to create a file input field. This
* component can only be used as a child of the {@link Field} component.
*
* The total size of the files that can be uploaded may not exceed 64 MB.
*
* @param props - The props of the component.
* @param props.name - The name of the file input field. This is used to
* identify the file input field in the form data.
* @param props.accept - The file types that the file input field accepts. If
* not specified, the file input field accepts all file types. For examples of
* valid values, see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept).
* @param props.compact - Whether the file input field is compact. Default is
* `false`.
* @param props.disabled - Whether the file input is disabled.
* @returns A file input element.
* @example
* <FileInput name="file" accept={['image/*']} />
* @example
* <FileInput name="file" compact />
* @example
* <Field label="Upload file">
* <FileInput name="file" />
* </Field>
*/
export const FileInput = createSnapComponent(TYPE);
//# sourceMappingURL=FileInput.mjs.map