FileTrigger
Opens the file browser from any button.
import {Button, FileTrigger} from 'alinea/components'
import {IcRoundUploadFile} from 'alinea/dashboard/icons'
export function FileTriggerExample() {
return (
<FileTrigger
accept={['.pdf']}
onSelect={([file]) => console.log(file.name)}
>
<Button variant="outline" icon={IcRoundUploadFile}>
Upload size guide
</Button>
</FileTrigger>
)
}Props
Opens the file browser when its child is clicked
PropTypeDefaultDescription
onSelect*(files: Array<File>) => voidDefault –Called with the picked files that match
accept, never with an empty listacceptArray<string>Default –Accepted mime types (
image/png, image/*) or file extensions (.pdf), every file is accepted if left outmultiplebooleanDefault –Allow picking more than one file
directorybooleanDefault –Pick a directory, every file in it is selected