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

Svelte · Cookbook

CookbookApp

`CookbookApp` (#3749): `AppShell` driven by a cookbook. A generated app needs a layout that renders this with `smrt.cookbook.json` (validated) and the catalog the server helper loads, plus one route that renders `CookbookSectionPage`.

Public export

typescript
import { CookbookApp } from '@happyvertical/smrt-svelte/cookbook';
Import path
@happyvertical/smrt-svelte/cookbook
Props
11
Props described
8 of 11
Bindable state
0
Callback events
1
Verified release
0.62.10

Props

Also accepts Omit<ComponentProps<typeof AppShell>, 'navGroups' | 'nav' | 'navMode' | 'layout' | 'onlayoutchange' | 'preset' | 'colorScheme' | 'borderRadius' | 'density' | 'contrast' | 'sectionHref' | 'title' | 'children'>, Pick<BuildCookbookShellOptions, 'recipeOrder' | 'entryPath' | 'sectionPath' | 'href' | 'title'>. The table lists the component-specific contract.

NameTypeRequiredDescription
cookbookCookbookYesNot described
catalogCookbookCatalogYesNot described
assistant{ component: Component<{ transport: AssistantTransport; registry: DataSurfaceRegistry; contextMode?: 'data-surfaces' | 'server'; visible?: boolean; messageFormat?: 'text' | 'markdown'; toolPresentation?: 'generic'; introduction?: { lists: string[]; actions: string[]; configured: boolean; }; }>; transport: AssistantTransport; registry: DataSurfaceRegistry; label?: string; /** Host-owned person-facing tool copy; raw provider history stays private. */ toolPresentation?: 'generic'; introduction?: { lists: string[]; actions: string[]; configured: boolean; }; }NoShared host composition supplies the dock, transport and surface registry.
embedbooleanNoEmbedded/plugin hosts keep their content and navigation without in-app chat.
fieldPoliciesReadonly<Record<string, ScreenPolicy>>NoResolved once by the owning policy engine at the server boundary.
navMode'sections' | 'sections-with-items'NoExpanded section entries are the default; use `sections` for headings only.
loadersCookbookLoadersNoData loaders for the `metric`, `records` and `chart` widgets. With `metric` and `records`, section pages also show a record count and the latest records of the section's lead model. `shortcuts` composes with the registry's own entries (see {@link CookbookShortcutsLoader}).
widgetContext() => Record<string, unknown>NoHost capabilities handed to widget loaders that run in the browser.
resolveExportRecipeExportResolverNoTurns a recipe export reference (`'@acme/shop/svelte#SalesTotal'`) into the export: a static map of dynamic imports in a bundled app. Without it, recipe `widget` and `shell-widget` surfaces are ignored.
oncookbookchange(cookbook: Cookbook) => voidNoCalled with the cookbook after a layout or overview edit.
childrenimport('svelte').SnippetYesNot described

Bindable state

This component has no bindable public state.

Callback events

  • oncookbookchange(cookbook: Cookbook) => void

Examples and explanation