npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

filestack-react

v7.0.1

Published

Official React component for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.

Readme

Contents

Overview

filestack-react is a thin wrapper around filestack-js. It gives you three picker components — overlay, inline, and drop pane — plus an optional context provider, and re-exports the full filestack-js client if you need the lower-level API. Anything you can do with filestack-js, you can do here.

The library is written in TypeScript and ships its own .d.ts files, so there's no @types/filestack-react to install.

Requirements

| | Version | |---|---| | React / React DOM | 18.3+ or 19 | | filestack-js | 4.x — installed by you as a peer dependency (see below) | | Node (to build/develop) | 18+ |

Install

filestack-js is a peer dependency as of v7, so install both packages:

npm install filestack-react filestack-js

If you skip filestack-js, npm will warn about an unmet peer dependency and the picker won't initialize.

Quick start

import { PickerOverlay } from 'filestack-react';

<PickerOverlay
  apikey={YOUR_API_KEY}
  onUploadDone={(res) => console.log(res.filesUploaded)}
/>

That's a working uploader. apikey is the only thing you have to pass (or set it once on a FilestackProvider).

Components

All three components take the same props. The only difference is how the picker is presented.

Overlay — opens the picker in a modal over your page:

<PickerOverlay apikey="YOUR_APIKEY" onUploadDone={handleUploadDone} />

Inline — renders the picker inside the page. Without a child container it draws a 500px-tall <div>:

<PickerInline apikey="YOUR_APIKEY" onUploadDone={handleUploadDone} />

Drop pane — a drag-and-drop target:

<PickerDropPane apikey="YOUR_APIKEY" onUploadDone={handleUploadDone} />

Bring your own container. Pass a single child element and the picker mounts into it (the component clones your element and gives it the id it needs):

<PickerInline apikey="YOUR_APIKEY">
  <div className="my-container" style={{ height: 400 }} />
</PickerInline>

Props

| Prop | Type | Required | Default | Description | |---|---|---|---|---| | apikey | string | Yes* | — | Your Filestack API key. *Optional on the component if a FilestackProvider supplies it. | | pickerOptions | object | No | {} | Passed to client.picker(...). See PickerOptions. displayMode is set for you per component. | | clientOptions | object | No | {} | Passed to Filestack(apikey, ...). See ClientOptions. | | onUploadDone | (res: PickerResponse) => void | No | no-op | Called when all files finish uploading. | | onError | (err) => void | No | no-op | Called if picker.open() rejects. | | onSuccess | (res: PickerResponse) => void | No | no-op | Deprecated — use onUploadDone. Still works; if both are set, onUploadDone is the one that fires. | | children | ReactElement | No | — | Optional custom container. Cloned with the generated id so the picker mounts inside it. |

Callbacks are silent by default in v7 — nothing is logged unless you pass a handler.

FilestackProvider

New in v7. If you use pickers in more than one place, set the shared values once instead of repeating them:

import { FilestackProvider, PickerOverlay, PickerInline } from 'filestack-react';

<FilestackProvider apikey={process.env.REACT_APP_FILESTACK_KEY}>
  <PickerOverlay onUploadDone={handleUploadDone} />
  <PickerInline pickerOptions={{ maxFiles: 3 }} />
</FilestackProvider>

How values resolve:

  • Scalars (apikey, onUploadDone, onError, onSuccess) — a prop set directly on a picker wins; otherwise the provider's value is used.
  • pickerOptions / clientOptions — shallow-merged, with the provider as the base and the component's options on top.

It's entirely opt-in. If you'd rather pass apikey to each picker, keep doing that — you don't need the provider.

TypeScript

The package bundles its own declarations — install it and import, no @types/* needed.

import {
  PickerOverlay,
  FilestackProvider,
  type PickerOverlayProps,
  type PickerResponse,
  type PickerOptions,
  type ClientOptions
} from 'filestack-react';

const pickerOptions: PickerOptions = { maxFiles: 5, accept: ['image/*'] };
const clientOptions: ClientOptions = { cname: 'cdn.example.com' };

const handleUploadDone = (res: PickerResponse) => {
  res.filesUploaded.forEach((file) => console.log(file.url));
};

const App = () => (
  <FilestackProvider apikey={process.env.REACT_APP_FILESTACK_KEY!}>
    <PickerOverlay
      pickerOptions={pickerOptions}
      clientOptions={clientOptions}
      onUploadDone={handleUploadDone}
      onError={(err) => console.error(err)}
    />
  </FilestackProvider>
);

Because PickerOptions, ClientOptions, and PickerResponse come from filestack-js, you get autocomplete on every nested option (maxFiles, accept, fromSources, transformations, and the rest).

Every public type is exported from the package root: PickerBaseProps, PickerOverlayProps, PickerInlineProps, PickerDropPaneProps, FilestackProviderProps, FilestackContextValue, and UsePickerResult, alongside the upstream filestack-js types.

The filestack-js client

Need the lower-level SDK? It's re-exported:

import { client } from 'filestack-react';

const fsClient = client.init('YOUR_APIKEY');
fsClient.upload(file);

Server-side rendering & frameworks

The picker runs in the browser — it initializes inside useEffect, so it never executes during a server render.

Next.js App Router. Every component ships with a 'use client' directive, so you can import them straight into your App Router files without wrapping them yourself:

// app/upload/page.tsx
import { PickerOverlay } from 'filestack-react';

export default function UploadPage() {
  return <PickerOverlay apikey={process.env.NEXT_PUBLIC_FILESTACK_KEY!} />;
}

Next.js Pages Router, Gatsby, and other SSG setups. These generally work as-is. If a build step tries to evaluate the picker on the server, load it client-side only:

import dynamic from 'next/dynamic';

const PickerOverlay = dynamic(
  () => import('filestack-react').then((m) => m.PickerOverlay),
  { ssr: false }
);

Migrating from v6

Most v6 apps need two changes: install filestack-js, and (eventually) rename one callback.

  1. Install filestack-js yourself. It's a peer dependency now:
    npm install filestack-react@7 filestack-js@^4
  2. Check your React and Node versions — React 18.3+ or 19, Node 18+. React 16/17 are no longer supported.
  3. Remove @types/filestack-react if you had it — types ship in the package now.
  4. Move off onSuccess when convenient. It still works but is deprecated; onUploadDone is the replacement.

| v6 | v7 | Notes | |---|---|---| | apikey, pickerOptions, clientOptions | same | Unchanged | | onUploadDone, onError | same | Unchanged | | onSuccess | onUploadDone | onSuccess still works but is deprecated | | filestack-js bundled as a dependency | filestack-js ^4 peer dependency | Install it in your app | | React 16/17/18 | React 18.3+ / 19 | | | plain JavaScript | TypeScript types included | Drop @types/filestack-react |

The picker UI itself now comes from filestack-js 4. If you relied on specific 3.x picker behavior, skim the filestack-js changelog.

Older migrations

| 3.x | 4.0.0 | Comment | |---|---|---| | apikey | apikey | | | actionOptions | pickerOptions | Consistent with other Filestack libs | | clientOptions | clientOptions | | | onSuccess | onSuccess | | | onError | onError | | | N/A | children | Used for a custom container | | action | N/A | Picker action is always pick | | file | N/A | Removed | | source | N/A | Removed | | customRender | N/A | Removed — you render the container | | componentDisplayMode | N/A | Removed — you render the container |

| 2.x | 3.0.0 | Comment | |---|---|---| | apikey | apikey | | | mode | action | | | options | actionOptions | | | preload | N/A | Assets are preloaded by default | | onSuccess | onSuccess | | | onError | onError | | | security | clientOptions.security | Grouped under clientOptions | | cname | clientOptions.cname | Grouped under clientOptions | | sessionCache | clientOptions.sessionCache | Grouped under clientOptions |

Development

Components live in src/picker/. After making a change:

npm run build   # bundle
npm run test    # unit tests, lint, and a build check
npm run test:types   # tsc --noEmit

Documentation

Full option reference (client methods, picker options) lives in the filestack-js docs: https://filestack.github.io/filestack-js/

Contributing

Contributions and ideas are welcome. We follow the Conventional Commits spec so the changelog stays consistent — please match it in your commit messages.