@anil-labs/file-picker-solid
v0.1.1
Published
SolidJS bindings for @anil-labs/file-picker-core — a media-library file picker with folders, upload, filters and metadata editing.
Maintainers
Readme
@anil-labs/file-picker-solid
SolidJS bindings for @anil-labs/file-picker — a media-library file picker with folders, upload, filters and metadata editing.
Install
npm i @anil-labs/file-picker-solidQuick start
import { FilePicker } from '@anil-labs/file-picker-solid'
import { createMemoryAdapter } from '@anil-labs/file-picker-core'
import '@anil-labs/file-picker-core/styles.css'
const adapter = createMemoryAdapter({ media: [], folders: [] })
function Demo() {
return <FilePicker adapter={adapter} multiple onSelect={(items) => console.log(items)} />
}Or drive it with the primitive:
import { useFilePicker } from '@anil-labs/file-picker-solid'
const { open, selected, isOpen } = useFilePicker({ adapter, multiple: true })
// `selected()` and `isOpen()` are accessorsAPI
<FilePicker … />— spreads allFilePickerOptionsas props (adapterrequired), pluslabel,showSelected, andonSelect/onChange/onUpload.useFilePicker(options)→{ selected (accessor), isOpen (accessor), open, close, setSelected, picker }.
Cleans up on scope dispose. Peer: solid-js ^1.8.
Documentation
https://anilkumarthakur60.github.io/file-picker/frameworks/solid
License
MIT © Er. Anil Kumar Thakur
