A button component that triggers a file upload dialog and handles file selection. It supports custom styling and a callback function to handle selected files. This is a raw component without any styling.
Name | Type | Default | Description |
---|---|---|---|
getFiles | (files: File[]) => void | - | A callback function that receives the selected files as an array. |
allowsMultiple | boolean | false | If true, multiple files can be selected. |
acceptedFileTypes | InputHTMLAttributes<HTMLInputElement>["accept"][] | - | An array of accepted file types, used to set the accept attribute on the input element. |
className | string | - | Additional CSS classes for custom styling of the button. |
children | React.ReactNode | - | The content inside the FileUploadButton component, typically the button label. |
...props | DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> | - | Additional props to be passed to the input element. |
Name | Type | Default | Description |
---|---|---|---|
className | string | - | Additional CSS classes for custom styling of the button. |
getFiles | (files: File[]) => void | - | Callback function that is called with the selected files. |
children | React.ReactNode | - | The content inside the FileUploadButton, usually the button label. |
...props | FileTriggerProps | - | Additional props to be passed to the FileTrigger component, including accept, multiple, etc. |
Check out the official documentation of React Aria FileTrigger for more information.
A styled button component that triggers a file upload dialog and handles file selection. It supports custom styling and a callback function to handle selected files. This is a raw component without any styling.
Name | Type | Default | Description |
---|---|---|---|
className | string | - | Additional CSS classes for custom styling of the button. |
getFiles | (files: File[]) => void | - | A callback function that receives the selected files as an array. |
variant | ButtonProps["variant"] | "primary" | Specifies the variant of the button, allowing for different styles (e.g., "primary", "secondary"). |
children | React.ReactNode | - | The content inside the FileUploadButton component, typically the button label. |
...props | FileTriggerProps | - | Additional props to be passed to the FileTrigger component. |
Check out the official documentation of React Aria FileTrigger for more information.