The Manage Metadata plugin will add a tiny 'edit' icon in front of the filename to allow updating the metadata of the uploaded file.
Install using npm:
npm install filepond-plugin-manage-metadata
Then import in your project:
import * as FilePond from 'filepond';
import FilePondPluginManageMetadata from 'filepond-plugin-manage-metadata';
Register the plugin:
FilePond.registerPlugin(FilePondPluginManageMetadata);
Create a new FilePond instance as normal.
const pond = FilePond.create({
name: 'filepond'
});
// Add it to the DOM
document.body.appendChild(pond.element);
The functionality will become active after uploading a file.
The following options can be provided:
const pond = FilePond.create({
name: 'filepond',
enableManageMetadata: true, // by default true, can be used to disable this plugin for a particular FilePond instance
labelButtonManageMetadata: 'custom label', // by default 'Edit metadata'
onManageMetadata: (item) => console.log('onManageMetadata hook called', item) // callback method which will be called upon clicking the edit icon
});