s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All UI components

Assets · Components

AssetGrid

Grid view of asset thumbnails with selection

Public export

typescript
import { AssetGrid } from '@happyvertical/smrt-assets/svelte';
Import path
@happyvertical/smrt-assets/svelte
Props
7
Props described
7 of 7
Bindable state
0
Callback events
3
Verified release
0.44.0

Props

NameTypeRequiredDescription
assetsPersistedAsset[]YesAssets to display
selectedIdsSet<string>YesCurrently selected asset IDs
onSelectionChange(ids: Set<string>) => voidYesCallback when selection changes
onAssetClick(asset: PersistedAsset) => voidYesCallback when an asset is clicked for detail view
onAssetDblClick(asset: PersistedAsset) => voidNoCallback when an asset is double-clicked
loadingbooleanNoWhether the grid is loading
modeAssetManagerModeNoOperating mode — drives the per-card action label ("Open" in manage mode, "Select" in pick mode, where a card click toggles selection).

Bindable state

This component has no bindable public state.

Callback events

  • onSelectionChange(ids: Set<string>) => void
  • onAssetClick(asset: PersistedAsset) => void
  • onAssetDblClick(asset: PersistedAsset) => void

Examples and explanation