Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Pearl Drop, animated React component

A file dropzone with a pearl in it. Drop files on the panel, browse, or drag one of the sample files underneath, and each file gets its own row with a progress bar whose head flows with rainbow light. The pearl is a halftone glass sphere: an empty shell of fine dots while you hold a file over it, then it fills from the bottom with swaying rainbow liquid as the newest upload runs, with the percentage in the middle, and a tick of bright dots rises through it when the file is done. A file that is too big, of the wrong type or that fails scatters the pearl red and says why in its row, with a retry for failures. Every row can be removed and Clear all empties the list.

  • Pro
  • Inputs & Controls
  • Spring
  • Glow

Props

PropTypeDefaultWhat it does
upload—Send each file somewhere and call onProgress with 0 to 1 as it goes. Leave it out and uploads are simulated.
onFile—Called with every file that passes the checks.
onRemove—Called with the name of a file removed from the list.
accept""The types let through, written like the accept attribute of a file input.
maxSizeMB20The biggest file allowed, in MB.
samplesthree made-up filesThe made-up files under the card that you can drag in to try it. An empty list hides the row.
hue0.5Where the pearl's colours start in the rainbow ramp, 0 to 1.
index"12"The number in the cell's corner.
caption"Pearl Drop"The name in the cell's corner.
barefalseDrop the dark card and keep the layout.
autoplayfalseDrags the sample files in by itself until the visitor touches it. Never runs under reduced motion.
className""Extra classes for the outer element.

Add it to your project

  1. 1

    Set up your project once

    You need a Next.js project with Tailwind CSS and the @/ import alias. In its root folder, run this once. It creates components.json and the cn() helper in src/lib/utils.ts:

    npx shadcn@latest init -d

    Starting from nothing? The Quick Start walks through the whole thing.

  2. 2

    Connect the registry with your API key

    Pearl Drop is a Pro item, so the CLI has to send your API key. Do this once per project:

    1. Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with nxs_ and is shown only once.
    2. In your project root, next to package.json, create a file named .env.local with this line, using your own key:
      NEXUS_API_KEY=nxs_your_key_here
    3. Open components.json and add this entry inside the outermost braces, next to "aliases". Leave {name} and ${NEXUS_API_KEY} exactly as written; the CLI fills them in:
      "registries": {
        "@nexus-labs": {
          "url": "https://www.nexus-ui.com/api/registry/{name}",
          "headers": {
            "Authorization": "Bearer ${NEXUS_API_KEY}"
          }
        }
      }

How Pearl Drop works

A dropzone with a pearl in it. Drop files on the panel (or browse, or drag one of the sample files underneath) and each one gets a row with its own progress bar with a flowing rainbow head. At rest the panel shows only its icon. The pearl is a halftone glass sphere: when that file is done the pearl dims and a tick of bright dots comes up through it. Held over, the panel lifts, a halftone of dots gathers under the pointer and a rainbow rim turns round it.

The source, the install command and the build prompt come with Pro.

Guides