smrt
Open the smrt source on GitHub Switch to dark color scheme
← All UI components

Svelte · Screens

RecipeScreens

List, view, create and edit for any model, derived from its manifest definition and resolved field policy (#3718). It is the default screen set for a package that ships models but no consumer UI: tags, facts, secrets, profiles, reports, prompts and the like.

Public export

typescript
import { RecipeScreens } from '@happyvertical/smrt-svelte/screens';
Import path
@happyvertical/smrt-svelte/screens
Props
18
Props described
14 of 18
Bindable state
2
Callback events
1
Verified release
0.62.10

Props

NameTypeRequiredDescription
surfacePathstringNoRoute declared by the active recipe; defaults to the selected collection entry path.
surfacePropsRecord<string, unknown>NoAdditional capabilities required by a recipe-owned route component.
entryIdstringNoDisambiguates keyed entries for the same model in the cookbook.
referencesScreenReferenceSourcesNoExposed target definitions, sources and optional record routes.
definitionScreenCollectionDefinitionYesNot described
policyScreenPolicy | nullNoResolved field policy for the same object; omit for the code seed.
sourceRecipeScreensSourceYesNot described
viewRecipeScreenViewNoCurrent screen (bindable).
recordIdstring | nullNoRecord shown by `view` and `edit` (bindable).
titlestringNoList title. Defaults to the pluralized class name.
columnsreadonly string[]NoExplicit list columns, in order.
fieldsreadonly string[]NoExplicit view / edit field names, in order.
currencystringNoNot described
localestringNoNot described
can{ create?: boolean; update?: boolean; delete?: boolean; }NoTurn operations off even when the source supports them.
onnavigate(view: RecipeScreenView, recordId: string | null) => voidNoCalled on every user navigation, for router synchronization.
definitionsParameters<typeof createRecipeScreenReferences>[0]NoEvery exposed collection definition, keyed by collection name; the record view derives this model's relations from it. Omit for none.
recordPick<RecordScreenProps, 'loaders' | 'registry' | 'widgetContext' | 'overview' | 'override' | 'onoverviewchange' | 'layoutEditing' | 'canCustomize' | 'hrefFor' | 'labels' | 'viewAllHref' | 'lineItemStoredTotals' | 'statusTones'>NoPassed to `RecordScreen` for the record view and edit.

Bindable state

  • bind:viewRecipeScreenView
  • bind:recordIdstring | null

Callback events

  • onnavigate(view: RecipeScreenView, recordId: string | null) => void

Examples and explanation