ObjectStackObjectStack

View

View protocol schemas

HTTP Method Enum & HTTP Request Schema

Migrated to shared/http.zod.ts. Re-exported here for backward compatibility.

Source: packages/spec/src/ui/view.zod.ts

TypeScript Usage

import { AddRecordConfig, AppearanceConfig, CalendarConfig, ColumnSummary, GalleryConfig, GanttConfig, GroupingConfig, GroupingField, KanbanConfig, ListChartConfig, ListColumn, NavigationConfig, NavigationMode, PaginationConfig, RowColorConfig, RowHeight, SelectionConfig, TimelineConfig, UserActionsConfig, ViewData, ViewFilterRule, ViewItemName, ViewKind, ViewScope, ViewSharing, ViewTab, VisualizationType } from '@objectstack/spec/ui';
import type { AddRecordConfig, AppearanceConfig, CalendarConfig, ColumnSummary, GalleryConfig, GanttConfig, GroupingConfig, GroupingField, KanbanConfig, ListChartConfig, ListColumn, NavigationConfig, NavigationMode, PaginationConfig, RowColorConfig, RowHeight, SelectionConfig, TimelineConfig, UserActionsConfig, ViewData, ViewFilterRule, ViewItemName, ViewKind, ViewScope, ViewSharing, ViewTab, VisualizationType } from '@objectstack/spec/ui';

// Validate data
const result = AddRecordConfig.parse(data);

AddRecordConfig

Add record entry point configuration

Properties

PropertyTypeRequiredDescription
enabledbooleanShow the add record entry point
positionEnum<'top' | 'bottom' | 'both'>Position of the add record button
modeEnum<'inline' | 'form' | 'modal'>How to add a new record
formViewstringoptionalNamed form view to use when mode is "form" or "modal"

AppearanceConfig

Appearance and visualization configuration

Properties

PropertyTypeRequiredDescription
showDescriptionbooleanShow the view description text
allowedVisualizationsEnum<'grid' | 'kanban' | 'gallery' | 'calendar' | 'timeline' | 'gantt' | 'map'>[]optionalWhitelist of visualization types users can switch between (e.g. ["grid", "gallery", "kanban"])

CalendarConfig

Properties

PropertyTypeRequiredDescription
startDateFieldstring
endDateFieldstringoptional
titleFieldstring
colorFieldstringoptional

ColumnSummary

Aggregation function for column footer summary

Allowed Values

  • none
  • count
  • count_empty
  • count_filled
  • count_unique
  • percent_empty
  • percent_filled
  • sum
  • avg
  • min
  • max

GalleryConfig

Gallery/card view configuration

Properties

PropertyTypeRequiredDescription
coverFieldstringoptionalAttachment/image field to display as card cover
coverFitEnum<'cover' | 'contain'>Image fit mode for card cover
cardSizeEnum<'small' | 'medium' | 'large'>Card size in gallery view
titleFieldstringoptionalField to display as card title
visibleFieldsstring[]optionalFields to display on card body

GanttConfig

Properties

PropertyTypeRequiredDescription
startDateFieldstring
endDateFieldstring
titleFieldstring
progressFieldstringoptional
dependenciesFieldstringoptional

GroupingConfig

Record grouping configuration

Properties

PropertyTypeRequiredDescription
fieldsObject[]Fields to group by (supports up to 3 levels)

GroupingField

Properties

PropertyTypeRequiredDescription
fieldstringField name to group by
orderEnum<'asc' | 'desc'>Group sort order
collapsedbooleanCollapse groups by default

KanbanConfig

Properties

PropertyTypeRequiredDescription
groupByFieldstringField to group columns by (usually status/select)
summarizeFieldstringoptionalField to sum at top of column (e.g. amount)
columnsstring[]Fields to show on cards

ListChartConfig

List chart view configuration

Properties

PropertyTypeRequiredDescription
chartTypeEnum<'bar' | 'line' | 'pie' | 'area' | 'scatter'>Chart visualisation type
xAxisFieldstringField used as the X axis / category dimension
yAxisFieldsstring[]Field(s) used as the Y axis / measures
aggregationEnum<'sum' | 'avg' | 'count' | 'min' | 'max'>optionalAggregation function applied to Y axis fields
groupByFieldstringoptionalOptional field used to split / stack the chart

ListColumn

Properties

PropertyTypeRequiredDescription
fieldstringField name (snake_case)
labelstringoptionalDisplay label override
widthnumberoptionalColumn width in pixels
alignEnum<'left' | 'center' | 'right'>optionalText alignment
hiddenbooleanoptionalHide column by default
sortablebooleanoptionalAllow sorting by this column
resizablebooleanoptionalAllow resizing this column
wrapbooleanoptionalAllow text wrapping
typestringoptionalRenderer type override (e.g., "currency", "date")
pinnedEnum<'left' | 'right'>optionalPin/freeze column to left or right side
summaryEnum<'none' | 'count' | 'count_empty' | 'count_filled' | 'count_unique' | 'percent_empty' | 'percent_filled' | 'sum' | 'avg' | 'min' | 'max'>optionalFooter aggregation function for this column
linkbooleanoptionalFunctions as the primary navigation link (triggers View navigation)
actionstringoptionalRegistered Action ID to execute when clicked

Properties

PropertyTypeRequiredDescription
modeEnum<'page' | 'drawer' | 'modal' | 'split' | 'popover' | 'new_window' | 'none'>
viewstringoptionalName of the form view to use for details (e.g. "summary_view", "edit_form")
preventNavigationbooleanDisable standard navigation entirely
openNewTabbooleanForce open in new tab (applies to page mode)
widthstring | numberoptionalWidth of the drawer/modal (e.g. "600px", "50%")

Allowed Values

  • page
  • drawer
  • modal
  • split
  • popover
  • new_window
  • none

PaginationConfig

Properties

PropertyTypeRequiredDescription
pageSizeintegerNumber of records per page
pageSizeOptionsinteger[]optionalAvailable page size options

RowColorConfig

Row color configuration based on field values

Properties

PropertyTypeRequiredDescription
fieldstringField to derive color from (typically a select/status field)
colorsRecord<string, string>optionalMap of field value to color (hex/token)

RowHeight

Row height / density setting for list view

Allowed Values

  • compact
  • short
  • medium
  • tall
  • extra_tall

SelectionConfig

Properties

PropertyTypeRequiredDescription
typeEnum<'none' | 'single' | 'multiple'>Selection mode

TimelineConfig

Timeline view configuration

Properties

PropertyTypeRequiredDescription
startDateFieldstringField for timeline item start date
endDateFieldstringoptionalField for timeline item end date
titleFieldstringField to display as timeline item title
groupByFieldstringoptionalField to group timeline rows
colorFieldstringoptionalField to determine item color
scaleEnum<'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'>Default timeline scale

UserActionsConfig

User action toggles for the view toolbar

Properties

PropertyTypeRequiredDescription
sortbooleanAllow users to sort records
searchbooleanAllow users to search records
filterbooleanAllow users to filter records
rowHeightbooleanAllow users to toggle row height/density
addRecordFormbooleanAdd records through a form instead of inline
buttonsstring[]optionalCustom action button IDs to show in the toolbar

ViewData

Union Options

This schema accepts one of the following structures:

Option 1

Properties

PropertyTypeRequiredDescription
providerstring
objectstringTarget object name

Option 2

Properties

PropertyTypeRequiredDescription
providerstring
readObjectoptionalConfiguration for fetching data
writeObjectoptionalConfiguration for submitting data (for forms/editable tables)

Option 3

Properties

PropertyTypeRequiredDescription
providerstring
itemsany[]Static data array

Option 4

Properties

PropertyTypeRequiredDescription
providerstring
schemaIdstringSchema identifier — typically the metadata type name
schemaRecord<string, any>optionalInline JSON Schema (Draft 2020-12). Optional when schemaId is resolvable.


ViewFilterRule

View filter rule

Properties

PropertyTypeRequiredDescription
fieldstringField name to filter on
operatorstringFilter operator (e.g. equals, not_equals, contains, this_quarter)
valuestring | number | boolean | null | string | number[]optionalFilter value


ViewKind

Whether config is a ListView (list family) or a FormView.

Allowed Values

  • list
  • form

ViewScope

View identity layer: package | shared | personal.

Allowed Values

  • package
  • shared
  • personal

ViewSharing

View sharing and access configuration

Properties

PropertyTypeRequiredDescription
typeEnum<'personal' | 'collaborative'>View ownership type
lockedBystringoptionalUser who locked the view configuration

ViewTab

Tab configuration for multi-tab view interface

Properties

PropertyTypeRequiredDescription
namestringTab identifier (snake_case)
labelstringoptionalDisplay label
iconstringoptionalTab icon name
viewstringoptionalReferenced list view name from listViews
filterObject[]optionalTab-specific filter criteria
orderintegeroptionalTab display order
pinnedbooleanPin tab (cannot be removed by users)
isDefaultbooleanSet as the default active tab
visiblebooleanTab visibility

VisualizationType

Visualization type that users can switch to

Allowed Values

  • grid
  • kanban
  • gallery
  • calendar
  • timeline
  • gantt
  • map

On this page