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, FormField, GalleryConfig, GanttConfig, GroupingConfig, GroupingField, KanbanConfig, ListColumn, ListView, NavigationConfig, NavigationMode, PaginationConfig, RowColorConfig, RowHeight, SelectionConfig, TimelineConfig, UserActionsConfig, ViewData, ViewFilterRule, ViewSharing, ViewTab, VisualizationType } from '@objectstack/spec/ui';
import type { AddRecordConfig, AppearanceConfig, CalendarConfig, ColumnSummary, FormField, GalleryConfig, GanttConfig, GroupingConfig, GroupingField, KanbanConfig, ListColumn, ListView, NavigationConfig, NavigationMode, PaginationConfig, RowColorConfig, RowHeight, SelectionConfig, TimelineConfig, UserActionsConfig, ViewData, ViewFilterRule, 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

FormField

Properties

PropertyTypeRequiredDescription
fieldstringField name (snake_case)
labelstring | ObjectoptionalDisplay label override
placeholderstring | ObjectoptionalPlaceholder text
helpTextstring | ObjectoptionalHelp/hint text
readonlybooleanoptionalRead-only override
requiredbooleanoptionalRequired override
hiddenbooleanoptionalHidden override
colSpanintegeroptionalColumn span in grid layout (1-4)
widgetstringoptionalCustom widget/component name
dependsOnstringoptionalParent field name for cascading
visibleOnstringoptionalVisibility condition expression

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

ListColumn

Properties

PropertyTypeRequiredDescription
fieldstringField name (snake_case)
labelstring | ObjectoptionalDisplay 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

ListView

Properties

PropertyTypeRequiredDescription
namestringoptionalInternal view name (lowercase snake_case)
labelstring | ObjectoptionalDisplay label: plain string or i18n translation object
typeEnum<'grid' | 'kanban' | 'gallery' | 'calendar' | 'timeline' | 'gantt' | 'map'>
dataObject | Object | ObjectoptionalData source configuration (defaults to "object" provider)
columnsstring[] | Object[]Fields to display as columns
filterObject[]optionalFilter criteria (JSON Rules)
sortstring | Object[]optional
searchableFieldsstring[]optionalFields enabled for search
filterableFieldsstring[]optionalFields enabled for end-user filtering in the top bar
quickFiltersObject[]optionalOne-click filter chips for quick record filtering
resizablebooleanoptionalEnable column resizing
stripedbooleanoptionalStriped row styling
borderedbooleanoptionalShow borders
selectionObjectoptionalRow selection configuration
navigationObjectoptionalConfiguration for item click navigation (page, drawer, modal, etc.)
paginationObjectoptionalPagination configuration
kanbanObjectoptional
calendarObjectoptional
ganttObjectoptional
galleryObjectoptionalGallery/card view configuration
timelineObjectoptionalTimeline view configuration
descriptionstring | ObjectoptionalView description for documentation/tooltips
sharingObjectoptionalView sharing and access configuration
rowHeightEnum<'compact' | 'short' | 'medium' | 'tall' | 'extra_tall'>optionalRow height / density setting
groupingObjectoptionalGroup records by one or more fields
rowColorObjectoptionalColor rows based on field value
hiddenFieldsstring[]optionalFields to hide in this specific view
fieldOrderstring[]optionalExplicit field display order for this view
rowActionsstring[]optionalActions available for individual row items
bulkActionsstring[]optionalActions available when multiple rows are selected
virtualScrollbooleanoptionalEnable virtual scrolling for large datasets
conditionalFormattingObject[]optionalConditional formatting rules for list rows
inlineEditbooleanoptionalAllow inline editing of records directly in the list view
exportOptionsEnum<'csv' | 'xlsx' | 'pdf' | 'json'>[]optionalAvailable export format options
userActionsObjectoptionalUser action toggles for the view toolbar
appearanceObjectoptionalAppearance and visualization configuration
tabsObject[]optionalTab definitions for multi-tab view interface
addRecordObjectoptionalAdd record entry point configuration
showRecordCountbooleanoptionalShow record count at the bottom of the list
allowPrintingbooleanoptionalAllow users to print the view
emptyStateObjectoptionalEmpty state configuration when no records found
ariaObjectoptionalARIA accessibility attributes for the list view
responsiveObjectoptionalResponsive layout configuration
performanceObjectoptionalPerformance optimization settings

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


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

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)
labelstring | ObjectoptionalDisplay 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