# Shadcn Sortable Images

> Image upload with sorting.

- Type: example, free and open source (MIT)
- Component: [File Upload](https://reui.io/components/file-upload.md)
- Page: https://reui.io/components/file-upload/c-file-upload-8
- Docs (Base UI): https://reui.io/docs/components/base/file-upload.md
- Docs (Radix UI): https://reui.io/docs/components/radix/file-upload.md
- MCP: `get_example("c-file-upload-8")`
- Registry item: https://reui.io/r/styles/base-nova/c-file-upload-8.json
- Uses: Alert, Button, Card, Progress, Sortable

## Best for

A 5 column grid reordered by a grip handle on hover, where new images join the same order as the sample shots

## Agent notes

- Each reorder calls `toast` from sonner, which shows nothing unless your app mounts its Toaster
- The order lives only in `allImages` state; save it from the `Sortable` `onValueChange` handler
- `simulateUpload` ticks a fake percent every 100ms; replace it with your upload inside `addImages`

## When not to use

- Photos kept in the order they were added, with no dragging: use [Product Images](https://reui.io/components/file-upload/c-file-upload-7.md) (`get_example("c-file-upload-7")`)

## Third-party libraries

- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/c-file-upload-8
```

## About Shadcn File Upload

### When to use

- Profile pictures and cover banners replaced by one pick or drop, with an instant local preview
- Multi file drop zones that check type, size and count, then list picks as thumbnails, cards or table rows
- Upload queues with per file progress and retry, and photo grids put in order by drag before saving

### When not to use

- Chips for files sent with a chat message, in the composer or the reply: use [Attachment](https://reui.io/components/attachment.md) (`get_component("attachment")`)
- A colored document icon labeled with its format, such as PDF or XLSX: use [File Type](https://reui.io/components/file-type.md) (`get_component("file-type")`)
- A meeting or booking form where an image drop is one field among many: use the [Schedule blocks](https://reui.io/blocks/application/schedule.md)

### Agent notes

- No example sends a picked `File` to a server; picks stay in React state until you add the upload request

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
