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

directus-extension-photo-gallery

v1.2.1

Published

A fullscreen, drag-and-drop sortable photo gallery interface for Directus files (M2M) relations, with an in-panel file-info editor and image editor.

Readme

Directus Photo Gallery

Directus License: MIT GitHub stars

A fullscreen, drag-and-drop sortable photo gallery interface for Directus — with an in-panel file editor and image editor.

Turn any Files (M2M) relation into a beautiful, reorderable gallery that feels just like the native File Library.

Photo Gallery demo


Features

  • Fullscreen gallery overlay — a dedicated, edge-to-edge surface for managing your photos, opened from a compact field summary that shows the live photo count.
  • Drag-and-drop reordering — grab any tile to reorder, with a lift animation and a clear drop-placeholder. The order is saved automatically.
  • Responsive grid + size control — a 4-step size selector (S / M / L / XL); wider windows fit more tiles per row. Your size choice is remembered.
  • Easy uploads — click Upload or drag files straight onto the overlay. Multi-file uploads supported, with a live progress bar.
  • Per-tile options menu (opens in place — no navigating away from your item):
    • Edit info — a side panel to replace the file and edit title, description, tags and location.
    • Edit image — an in-panel crop / rotate / flip editor.
    • Download the file.
    • Delete the file permanently (with confirmation).
  • Bulk actions — Select All, then download or delete the selection from the header. Native-style delete confirmation.
  • Save-as-you-go — on an existing item, uploads, reorders and deletes are persisted immediately, just like the File Library. Inline status confirms every action ("Photo order updated", "Image saved", …).
  • File-card layout — familiar Directus cards with thumbnail, title, and an EXT • SIZE subtitle.
  • Configurable — pick the upload folder and whether new photos are added on top or at the end, per field.

Installation

Directus Marketplace (recommended)

In your Directus project, open Settings → Marketplace, search for Photo Gallery, and click Install. That's it — no configuration required.

Manual / self-hosted

Install it as a dependency of your Directus project:

npm install directus-extension-photo-gallery

Directus automatically loads extensions found in your dependencies. Restart Directus after installing.

Alternatively, copy a built copy of this extension into your project's extensions/ folder so the path is extensions/directus-extension-photo-gallery/ (make sure dist/index.js is present), then restart Directus.


How to use

1. Create a Photo Gallery field

  1. Open the collection you want the gallery on and go to Data Model → Create Field.
  2. Choose Relational → Files.
  3. Pick Photo Gallery as the Interface.

This creates a many-to-many relation to directus_files — one field can hold many photos.

2. Add a Sort field (required for ordering)

Drag-ordering is stored on the relation, so the field must have a sort field. Set it once while creating the field:

  1. Choose Continue in Advanced Field Creation Mode.
  2. Open the Relationship panel.
  3. Set Sort Field to sort (Directus creates the column for you).
  4. Save.

Without a sort field the gallery still works, but it shows an "Order won't save" warning and reordering won't persist.

3. Configuration options

Available in the field's Interface settings:

| Option | Description | Default | | ----------------------- | ------------------------------------------------------------------------------------------------------------- | ---------- | | Upload Folder | The Directus folder that newly uploaded files are placed into. | Root | | New Photos Position | Where newly uploaded photos are inserted: at the end (after existing photos) or on top (before them). | At the end |

Tile size (S / M / L / XL) is controlled from inside the gallery and remembered per browser; thumbnails always use cover (crop to fill).


Notes

Saving behaviour. On an existing item, uploads / reorders / deletes are written immediately (like the File Library) and aren't tied to the item's Save/Discard. On a brand-new, unsaved item there's no id to link to yet, so newly added photos are staged and committed when you first save the item.

Image editor. Directus' native image editor is an internal app view that extensions can't embed, so Edit image uses a bundled editor (crop / rotate / flip). Saving overwrites the file's binary, and the export requires assets to be served same-origin (the normal Directus setup).


Development

npm install       # install the toolchain
npm run dev       # rebuild on save
npm run build     # produce dist/index.js

Source lives in src/src/index.ts (field definition & options) and src/interface.vue (all UI + logic). Built with the Directus Extensions SDK, Sortable.js and Cropper.js.


Contributing

Issues and pull requests are welcome — please open them on GitHub.

License

MIT © koendhoore