For AI agents: an index of this documentation is at https://developer.rippling.com/llms.txt. Public pages have a Markdown version at the same URL with .md added.

Skip to main content
guide

Get started with function pages

Learn how function pages work in App Studio, how Server-Driven UI (SDUI) specs are rendered, and the lifecycle of server and client interactions.

Use with AI:Rippling AI ChatGPT Claude Cursor

Overview​

A function page is an App Studio page backed by a Rippling function. You return an SDUI spec—a JSON description of layout, state, bindings, and handlers—and Rippling renders it with native components from the component catalog.

Server-Driven UI (SDUI) is the spec format and runtime behind function pages. You author specs in TypeScript with @rippling/pebble-sdui-web and the custom-apps catalog.


Why use function pages?​

No custom frontend — Ship TypeScript that returns a spec instead of maintaining a separate React app.

Native Rippling UI — Specs use the same component catalog as the rest of the product.

Full layout surface — Grids, modals, drawers, navigation, repeats, and forms are available from the catalog.

Server-driven logic — Return different UI or data based on the user, role, or live backend state—without a separate frontend deployment.


Documentation map​

DocUse it for
Get started (this page)What function pages are, lifecycle, when the server runs
Hello WorldFirst function and SDUI spec end to end
Server round-tripstriggerFunction and multiple action handlers
State & Data Binding$state, $bindState, repeats, and local actions
ComponentsSearchable props and events for each catalog component
ReferenceImports, render, component directives, actions table

What an SDUI spec includes​

A single SDUI spec can define everything the function page needs at runtime:

  • Layout — Which components appear and how they are arranged.
  • State — Initial values the page reads and writes.
  • Bindings — Inputs connected to state paths (for example $bindState('/name')).
  • Event handlers — Actions attached via on (clicks, changes, navigation).
  • Visibility — Conditional display with logic helpers.
  • Repeats — Lists driven by arrays in state.

Most client-side interactions (typing, toggling, simple button actions) run from the spec without calling your function again. Server work uses triggerFunction or other actions that invoke your handler with a new action value.


How a function page loads​

When someone opens the function page:

  1. Rippling calls your function with action: 'init'.
  2. Your function returns an SDUI spec.
  3. Rippling renders the page from that spec.

When a user interacts with the page:

  1. Local updates (bound inputs, setState, notifications) happen in the browser.
  2. Actions that need server logic call your function again (for example via triggerFunction) with inputs.action and any additional values the handler needs.
┌─────────┐              ┌─────────────────────┐              ┌──────────────────┐
│ Browser │ │ Rippling UI │ │ Server Function │
└────┬────┘ └──────────┬──────────┘ └────────┬─────────┘
│ │ │
│ 1. User opens page │ │
├─────────────────────────────>│ │
│ │ 2. Invoke function (init) │
│ ├─────────────────────────────────>│
│ │ │
│ │ 3. Return SDUI spec (JSON) │
│ │<─────────────────────────────────┤
│ │ │
│ 4. Render native components │ │
│<─────────────────────────────┤ │
│ │ │
│ 5. User action needs server │ │
├─────────────────────────────>│ 6. Invoke function again │
│ ├─────────────────────────────────>│

Typical authoring flow​

  1. Define state paths your page will use (even empty strings or arrays).
  2. Build the component tree with catalog helpers (VStack, Text, Button, …).
  3. Connect inputs with $bindState and display values with $state or $template.
  4. Return render({ root, state }) from onRipplingEvent when action === 'init'.

Start with Hello World to render a minimal function page, then Server round-trips when a button or action needs to call a Rippling function.