# [FilePond](https://filepond.com) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/pqina/filepond/blob/v/LICENSE) [![npm version](https://badge.fury.io/js/filepond.svg?v5)](https://www.npmjs.com/package/filepond) ![npm](https://img.shields.io/npm/dt/filepond) [![Discord](https://img.shields.io/discord/1422126182924554291?label=discord)](https://discord.gg/KTyymsrTrX) A JavaScript library that can upload anything you throw at it, optimizes images for faster uploads, and offers a great, accessible, silky smooth user experience. ## Installing FilePond Install the `filepond` package by running the following command in your terminal: ``` npm install filepond ``` ## Quick Start Wrap an `` with the `` custom element and then register the custom element using the `defineFilePond` function. [Getting started](https://filepond.com/docs/start-here/getting-started) ```html
``` ## Integrating FilePond With a Framework When integrating with a framework like React, Svelte, Vue, or Angular we can use the `` custom element as if it were a Component. [Framework integration](https://filepond.com/docs/start-here/framework-integration) ```tsx import { useState } from 'react'; // FilePond imports import { defineFilePond, type FilePondEntrySource, type FilePondElement } from 'filepond'; import { locale } from 'filepond/locales/en-gb.js'; // Optionally import React component types import 'filepond/types/react'; // Define element and sets English locale defineFilePond({ locale, }); export default function App() { // two-way data binding const [entries, setEntries] = useState([ new File(['hello'], 'world.txt', { type: 'text/plain', }), ]); // handle form submit function handleSubmit(e: React.SyntheticEvent) { e.preventDefault(); console.log('submit', e); } return (
{ setEntries(currentEntries); }} entries={entries} >
); } ``` ## License [MIT](LICENSE.md)