Skip to main content

Compose app surfaces

Surfaces are the pages shown in an installed app's navigation. They let you present a cohesive product while reusing mature TWL Tool experiences.

TypeUse it forRequired binding
frontendPageA custom overview, dashboard, or guided UIpage
dataWorkspaceViewRecords, saved content, and app datatable; optional viewKey
documentA document or a folder of documentsexactly one of document, documentFolder
chatAI chat constrained to one app workflowpreset.workflow
contentSchedulerScheduling documents from an appoptional documentFolder and space

Declare navigation

ui: {
icon: 'sparkles',
color: '#6574f7',
defaultSurface: 'overview',
surfaces: [
{
key: 'overview',
label: 'Overview',
type: 'frontendPage',
page: ref('frontendPages', 'overview'),
},
{
key: 'inspiration',
label: 'Inspiration',
type: 'dataWorkspaceView',
table: ref('dataWorkspaceTables', 'inspiration'),
viewKey: 'gallery',
},
{
key: 'drafts',
label: 'Drafts',
type: 'document',
documentFolder: ref('documentFolders', 'drafts'),
},
],
}

If surfaces exist and defaultSurface is omitted, defineApp() selects the first surface.

Choose the smallest custom surface

A custom page is ideal for product-specific composition. Once a user enters a specialized task, navigate to the native surface that already owns the behavior. This preserves accessibility, permissions, updates, and consistent data handling across TWL Tool.