Database
Gallery View
Cards with a page preview area and the title, in a responsive grid.
Tasks
Usage
- Use the gallery layout when each row has visual content (a cover or page preview) that helps recognition.
- Pick
cardSizeby how much of the preview matters:smallfor many rows,largefor rich previews. - Don’t use a gallery for dense, text-only records; use the list or table layout instead.
Installation
Install the package (React 19):
terminal
terminal
terminal
Import the styles once, in your app entry or root layout:
/src/main.tsx
Use it anywhere inside your app's <Theme> (see Installation):
/src/GalleryViewExample.tsx
Examples
Card size
Composition
Views read the database from context, so render them inside <DatabaseView> (which picks the active view for you) or inside your own <DatabaseProvider value={useDatabase(...)}>.
anatomy
API Reference
GalleryView
| Prop | Type | Default |
|---|---|---|
onOpenRow | (row: Row) => void | |
cardSize | "small""medium""large" | "medium" |
hoveredRowId | string |
Accessibility
- Cards are
role="link"withtabIndex=0; Enter opens the page.
© 2026 Motion. Internal documentation.