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

Jobs · Components

JobList

JobList - Display a filterable, sortable list of background jobs. Sorting follows the list-sort contract (`@happyvertical/smrt-ui/data`): every column header toggles its column ascending/descending (dates and counts start with the largest). Rows keep the order they are supplied in until the host passes `sort` or the person activates a header, so a host that already orders its jobs is not silently reordered. A parent that pages on the server passes `sort` + `onSortChange` and supplies rows already in that order.

Public export

typescript
import { JobList } from '@happyvertical/smrt-jobs/svelte';
Import path
@happyvertical/smrt-jobs/svelte
Props
12
Props described
12 of 12
Bindable state
0
Callback events
5
Verified release
0.57.40

Props

NameTypeRequiredDescription
jobsJobData[]YesJobs to display
loadingbooleanNoLoading state
selectablebooleanNoSelectable rows
selectedSet<string>NoSelected job IDs
showActionsbooleanNoShow actions column
onSelectionChange(selected: Set<string>) => voidNoCallback when selection changes
onJobClick(job: JobData) => voidNoCallback when job is clicked
onRetry(job: JobData) => voidNoCallback when retry is clicked
onCancel(job: JobData) => voidNoCallback when cancel is clicked
emptySnippetNoEmpty state snippet
sortListSortNoCurrent order. Omitted: rows render as supplied (headers show no sort) until a header is activated.
onSortChange(sort: ListSort) => voidNoCalled when a header is activated. When given, the parent owns the order (e.g. a server-sorted list) and `jobs` are rendered as supplied.

Bindable state

This component has no bindable public state.

Callback events

  • onSelectionChange(selected: Set<string>) => void
  • onJobClick(job: JobData) => void
  • onRetry(job: JobData) => void
  • onCancel(job: JobData) => void
  • onSortChange(sort: ListSort) => void

Examples and explanation