Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Pointer Glow Dropzone File Upload Block for React

A deep inset drop zone whose 1 px edge lights up where the pointer is and glows evenly on focus, over a tray of attachment rows with Remove and Clear tray.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Give the drop target some presence without a dark section, with this file upload panel for React with Base UI. It is the footage drop of Slatewire, a transfer tool for video editors. The File Upload drop zone sits on a deep inset ground, a mix of the theme's own muted and background colors, so it follows light and dark themes. Its 1 px edge is lit by one radial gradient that follows the pointer, driven by two CSS custom properties set from a single pointer-move handler; when the zone has focus the whole edge glows evenly. On touch screens and with reduced motion only the static ring and the focus glow remain. Picked files sit in a tray of Attachment rows, each with its file glyph, name, size and a Remove button, and a Clear tray Button empties it. The frame's bands are ruled by Guides. It is built from File Upload, Attachment, Button and Guides, with a CSS entrance only. For media tools, transfer apps and any upload that wants a deliberate target.

FAQ

Why is it called dark if it follows the theme?

The slug keeps the original name. The zone's ground is color-mix of the theme's muted and background colors, so in a light theme it is a soft inset and in a dark theme it is deep. Nothing is forced dark.

How does the edge light work?

The zone sits in a wrapper with 1 px of padding in the border color. Behind the zone, a layer paints a radial gradient centred on --mx and --my, which the pointer-move handler sets in the wrapper's own pixels, and fades in on hover. A second layer fades in on focus and lights the whole edge. Both are hidden under reduced motion, and the gradient is also hidden on coarse pointers.

What is in the tray?

Catalog Attachment rows. Two files are typed to start: one marked added and one ready. Picked files join as ready. Each row names its file, shows the real size and a Remove button that says which file it removes; Clear tray answers "The tray is already empty." when there is nothing to clear.

Does it read my footage?

No. The block keeps each file's name and size and nothing else, and says so in a polite status line from load. Files over 4 GB are refused with a message. Nothing is sent or saved.

How does it work from the keyboard?

The zone is a button: Tab to it, press Enter or Space to open the picker. Focus lights its edge. The tray is a scroll region you can focus, and each Remove button is reachable in order.

How do I connect it to my transfer service?

Start a transfer for each file in the accepted handler and change a row's state to uploading, processing or done as your service reports. The Attachment states exist for that; the block only uses done and idle.

  • Pro

    A project folder's drop zone that folds into a slim Add more strip over its file list as files arrive, with a running total against 25 MB, Remove on each row and Clear all.

  • Pro

    A drawn project brief that is itself the drop zone: nothing shows until a file is dragged over it, then a full-bleed message appears, and dropped files join an attachments list with a short bar.

  • Pro

    A file drop zone that lists every file you pick or drop (name and size, never opened) beside a queue of four seeded files in their states, with Retry, Remove and a Send button.

  • Pro

    A per-file size cap set with a slider (5 to 100 MB) and a total meter with an 80% tick; files over the cap or past the total are listed with the reason and not counted.

  • Pro

    An illustrated empty state whose drawn folder is the drop zone: a pick closes the folder and lists the file, with working Add files, Paste a link and New folder shortcuts.

  • Pro

    A phone-first uploader drawn in a 360 px device frame: a large Choose files target, a Take photo camera shortcut, compact file chips and a bottom drawer quick look with Remove.