Mosaic
import { Mosaic } from '@dxos/react-ui-mosaic';npm install @dxos/react-ui-mosaic @dxos/react-ui-dndMosaic lays out tiles the user can drag. A container’s eventHandler decides what the container takes and what a
drop means. The package draws the tiles and handles the drag.
Board is built from these parts.
Add the package’s strings from @dxos/react-ui-mosaic/translations to the resourceExtensions of Theme.Provider.
| Part | What it is |
|---|---|
Mosaic.Container |
A drop target. Its eventHandler decides what it takes |
Mosaic.Stack |
A list of tiles from items, one Tile each |
Mosaic.VirtualStack |
A stack that draws only the tiles in view, and can load pages as it scrolls |
Mosaic.Tile |
A draggable tile with an id, its data and its location |
Mosaic.DragHandle |
The handle that drags its tile |
Mosaic.ResizeHandle |
An edge that resizes its tile |
Mosaic.Placeholder |
The gap a drop would land in |
Mosaic.DropIndicator |
The line where a drop would land |