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

Collections and tables

CollectionList

No summary has been written for CollectionList. Everything below is generated from the declaration shipped in 0.44.0 and describes the real contract.

Public export

typescript
import { CollectionList } from '@happyvertical/smrt-ui/data';
Import path
@happyvertical/smrt-ui/data
Props
14
Props described
14 of 14
Bindable state
1
Callback events
2
Verified release
0.44.0

Props

NameTypeRequiredDescription
itemsT[]YesArray of items to display in the list or grid.
itemKeykeyof T | ((item: T) => string | number)NoField name or function to uniquely identify each item.
titlekeyof T | ((item: T) => string)NoField name or function to extract the title text for each item.
descriptionkeyof T | ((item: T) => string | undefined)NoField name or function to extract the description text for each item.
layout'list' | 'grid'NoDisplay layout: list (single column) or grid (multiple columns).
selectablebooleanNoWhether to show checkboxes for selecting multiple items.
selectedSet<string | number>NoSet of currently selected item keys (bindable).
loadingbooleanNoWhether to show a loading spinner instead of the collection.
itemSnippet<[{ item: T; index: number; selected: boolean; }]>NoCustom snippet to render each item's content.
actionsSnippet<[{ item: T; index: number; }]>NoCustom snippet to render action buttons for each item.
emptySnippetNoCustom snippet to render when there are no items.
onselectionchange(selected: Set<string | number>) => voidNoCallback when the selection set changes.
onitemclick(item: T, index: number) => voidNoCallback when an item is clicked.
classstringNoCSS class to apply to the collection container.

Bindable state

  • bind:selectedSet<string | number>

Callback events

  • onselectionchange(selected: Set<string | number>) => void
  • onitemclick(item: T, index: number) => void

Examples and explanation