UploadKit
SDK@uploadkitdev/react

UploadBento

A CSS grid bento layout where every third cell spans 2 columns — each cell is a mini upload card.

A CSS grid bento layout where every third cell spans 2 columns (grid-auto-flow: dense). Each cell is a mini upload card with file icon, name, size, and a slim progress bar at the bottom. Completed cells reorder to the top with a Motion layout animation when the peer dep is installed.

Design inspiration: Apple iPadOS homescreen widgets, Raycast themes grid.

motion is an optional peerDependency. Without it, cells do not reorder — they stay in drop order. pnpm add motion to enable smooth grid reflow.

Drop files or click to build your bento.

Apple iPadOS · Raycast themes — bento grid

Basic usage

import { UploadBento } from '@uploadkitdev/react';

export default function Page() {
  return (
    <UploadBento
      route="gallery"
      accept={['image/*', 'video/*']}
      maxFiles={12}
      columns={3}
      onUploadComplete={(results) => {
        console.log('Uploaded:', results.length);
      }}
    />
  );
}

Props

PropTypeDefaultDescription
routestringRequired. Route name from your file router.
acceptstring[]Accepted MIME types.
maxSizenumberMaximum file size in bytes.
maxFilesnumberMaximum number of files per drop or selection.
metadataRecord<string, unknown>JSON-serializable metadata forwarded to the server.
columnsnumber3Grid column count (applied via the --uk-bento-cols custom property).
onUploadComplete(results: UploadResult[]) => voidCalled when every accepted file has uploaded.
onUploadError(error: Error) => voidCalled once per failed file.
classNamestringAdditional CSS class(es) merged onto the outer wrapper.

Theming

VariablePurpose
--uk-bento-colsNumber of columns (inline-styled from columns prop)
--uk-bg-secondary, --uk-border, --uk-textContainer and cell chrome
--uk-progress-track, --uk-progress-fillPer-cell progress bar
--uk-success, --uk-errorBorder color on success / error

Accessibility

  • Outer grid is role="region" with aria-label="Upload bento grid"
  • Each cell is role="progressbar" with per-file aria-valuenow
  • Focusable via keyboard; Enter and Space open the file picker
  • Respects prefers-reduced-motion — layout animations collapse to 0.01ms

On this page