ObjectStackObjectStack

Page Metadata

Build custom pages with component-based layouts, variables, and event handling

Page Metadata

A Page defines a custom UI layout using components, regions, and variables. Unlike Views which are bound to a single Object, Pages are flexible containers that can combine multiple components, embed views, and manage local state.

Basic Structure

const homePage = {
  name: 'sales_home',
  label: 'Sales Home',
  type: 'home',
  regions: [
    {
      name: 'header',
      width: 'full',
      components: [
        {
          type: 'metric_card',
          id: 'total_revenue',
          label: 'Total Revenue',
          properties: {
            object: 'opportunity',
            field: 'amount',
            aggregate: 'sum',
            format: 'currency',
          },
        },
      ],
    },
    {
      name: 'main',
      width: 'large',
      components: [
        {
          type: 'list_view',
          id: 'recent_deals',
          label: 'Recent Deals',
          properties: {
            object: 'opportunity',
            view: 'recent_open',
            limit: 10,
          },
        },
      ],
    },
  ],
};

Page Properties

PropertyTypeRequiredDescription
namestringMachine name (snake_case)
labelstringDisplay label
descriptionstringoptionalPage description
typeenumPage type (see below)
objectstringoptionalAssociated object (for record type)
templatestringoptionalLayout template name (default: 'default')
regionsPageRegion[]Layout regions with components
variablesPageVariable[]optionalLocal state variables
isDefaultbooleanoptionalIs default page for its type
assignedProfilesstring[]optionalProfiles that can access this page

Page Types

TypeDescriptionUse Case
recordTied to a specific object recordCustom detail pages
homeLanding/home pageApp entry points
appGeneral application pageCustom layouts
utilityUtility/helper pageTools, settings, wizards

Regions

Regions define layout zones on the page. Each region contains components.

regions: [
  {
    name: 'sidebar',
    width: 'small',
    components: [/* ... */],
  },
  {
    name: 'content',
    width: 'large',
    components: [/* ... */],
  },
]
PropertyTypeRequiredDescription
namestringRegion identifier
widthenum'small', 'medium', 'large', 'full'
componentsPageComponent[]Components in this region

Components

Components are the building blocks placed inside regions.

{
  type: 'chart',
  id: 'revenue_chart',
  label: 'Revenue Trend',
  properties: {
    chartType: 'line',
    object: 'opportunity',
    categoryField: 'close_date',
    valueField: 'amount',
  },
  events: {
    onClick: 'navigate("/opportunities/{id}")',
  },
  visibility: "userProfile = 'sales_manager'",
  style: { height: '400px' },
}
PropertyTypeRequiredDescription
typestringComponent type or custom component name
idstringUnique component identifier
labelstringoptionalDisplay label
propertiesRecord<string, any>optionalComponent-specific configuration
eventsRecord<string, string>optionalEvent handlers (action expressions)
styleobjectoptionalCSS styles
classNamestringoptionalCSS class names
visibilitystringoptionalVisibility condition expression

Variables

Pages can define local variables for managing state across components.

variables: [
  {
    name: 'selected_tab',
    type: 'text',
    defaultValue: 'overview',
  },
  {
    name: 'date_range',
    type: 'object',
    defaultValue: { start: null, end: null },
  },
]

Complete Example

const accountRecordPage = {
  name: 'account_detail',
  label: 'Account Detail',
  type: 'record',
  object: 'account',
  variables: [
    { name: 'active_tab', type: 'text', defaultValue: 'details' },
  ],
  regions: [
    {
      name: 'header',
      width: 'full',
      components: [
        {
          type: 'record_header',
          id: 'header',
          properties: {
            fields: ['name', 'type', 'industry', 'owner'],
            actions: ['edit', 'delete', 'clone'],
          },
        },
      ],
    },
    {
      name: 'sidebar',
      width: 'small',
      components: [
        {
          type: 'record_detail',
          id: 'key_fields',
          label: 'Key Fields',
          properties: {
            fields: ['annual_revenue', 'employees', 'website', 'phone'],
          },
        },
        {
          type: 'activity_timeline',
          id: 'activities',
          label: 'Activity',
        },
      ],
    },
    {
      name: 'main',
      width: 'large',
      components: [
        {
          type: 'related_list',
          id: 'contacts',
          label: 'Contacts',
          properties: { object: 'contact', relationship: 'account' },
        },
        {
          type: 'related_list',
          id: 'opportunities',
          label: 'Opportunities',
          properties: { object: 'opportunity', relationship: 'account' },
        },
      ],
    },
  ],
};

On this page