Gallery picker (media library)
The server-paged media library as a picker: folder tree, search, upload in place (with per-file progress and type errors), multi-select with a running count, and the media-library grants (Q7) deciding who can upload.
Covers: gallery-picker primitive, picker designer. Exports: GalleryPicker.
Anatomy
The component as it sits in the product: English, compact, real data shapes.
States
5 states, left to right, top to bottom. A mock poll never finishes, so each state is drawn on purpose.
This folder is empty
Upload from the camera roll.
Density
The phone shell is always comfortable (POWERUPS #15): 44px tap targets, 16px inputs. Compact exists on desktop only; see the desktop page.
English · 中文
Staff pick en or cn (T001 Q25). Labels arrive localised; CJK falls back to PingFang SC / Noto Sans SC.
Long string · permission denied
The long-string case (PL-063) and what a role without the permission sees (the server decides; T003).
Contract
The @rj/admin-kit API for this family. Mirrored in CONTRACT.md.
- Export
GalleryPicker·@rj/admin-kit- Props
folder·multiple·accept·onPick·upload- States
- loading · ready · selected · uploading · upload-error · empty · error · browse-only
- shadcn / Radix
- Dialog (picker) + ScrollArea + Checkbox
- Package underneath
- react-query (paged) · react-dropzone · react-virtual
- Accessibility
- grid of checkbox tiles; the count is announced
- API operations
- admin.media-library.list · admin.media-library.tree · admin.media-library.file
- Phone variant
- 2-column grid, upload from camera roll
- Permission
- media-library grants (Q7)