Pages
A page is a React component stored in the platform and rendered in the app. Two roles per entity:
| Role | Replaces |
|---|---|
| View page | The default record detail view |
| Create page | The default create form |
Pages are compiled at runtime, so a deploy takes effect without rebuilding the app.
Writing one
Section titled “Writing one”Pages are ordinary React with versioned imports:
import React, { useEffect, useState } from "react@19.2.5";import { Stack, Typography } from "@mui/material@7.3.10";import { createController } from "platform:stdlib";import type IssueController from "../controllers/IssueController.ts";
const controller = createController<IssueController>();
export default function IssueView({ recordId }: CustomViewProps) { const [issue, setIssue] = useState(null);
useEffect(() => { controller.getIssueDetail({ recordId }).then(setIssue); }, [recordId]);
return <Stack><Typography>{issue?.title}</Typography></Stack>;}Versioned specifiers pin what the page was written against, so a platform upgrade cannot silently change a page’s behavior.
Data comes from controllers — a page fetches through a typed client rather than querying directly.
Deploying
Section titled “Deploying”Pages live under guest_files/views/, with metadata in pages/_meta.json. A
full deploy includes them:
polymesa deploy ./configTo iterate on pages alone:
polymesa pages deploy ./config --dry-runpolymesa pages retrieve ./configAttaching
Section titled “Attaching”Assign a page as an entity’s view or create page in the app’s model settings, or by deploying the entity definition that references it. Standalone pages are also reachable by their durable id, for dashboards belonging to no single entity.