Back to Knowledge Base
Building a Sidebar Page App
What is a Page app?
Section titled “What is a Page app?”A Page app appears in the left sidebar and opens as a full-height, full-width page. It’s the most common app kind — suitable for tools, dashboards, and any interface your team uses regularly.
Layout pattern
Section titled “Layout pattern”<div class="flex h-screen bg-base-100"> <!-- Optional sidebar --> <div class="w-64 bg-base-200 border-r border-base-300 p-4"> <!-- Navigation --> </div> <!-- Main content --> <div class="flex-1 overflow-auto p-6"> <!-- Content --> </div></div>Loading data
Section titled “Loading data”A Page app fetches platform data through its server API: the client calls a handler
with window.rpc, and the handler runs ctx.graphql. (Full detail in
Accessing Platform Data.)
Server API (serverApi.lua):
exports = {}
function exports.listRecentJobs() local res = ctx.graphql.query([[ query { listJobs(first: 20) { edges { node { id name status } } } } ]]) return { status = "ok", result = res.data.listJobs.edges }endScript (client):
const jobs = ref([]);
onMounted(async () => { const r = await window.rpc('listRecentJobs'); jobs.value = r.result.map(e => e.node);});
const setupReturn = { jobs };- Use
h-screenon the root element to fill available height - The platform provides the top nav bar — don’t recreate it
- Use
overflow-autoon content areas to handle long content - Load data in
onMountedand keep reactive state inref()