# 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.

## 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](https://developer.rippling.com/documentation/rippling-platform/sdui/components).

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

| Doc | Use it for |
| --- | --- |
| **Get started** (this page) | What function pages are, lifecycle, when the server runs |
| [Hello World](https://developer.rippling.com/documentation/rippling-platform/sdui/hello-world) | First function and SDUI spec end to end |
| [Server round-trips](https://developer.rippling.com/documentation/rippling-platform/sdui/server-round-trips) | `triggerFunction` and multiple `action` handlers |
| [State & Data Binding](https://developer.rippling.com/documentation/rippling-platform/sdui/state-data-binding) | `$state`, `$bindState`, repeats, and local actions |
| [Components](https://developer.rippling.com/documentation/rippling-platform/sdui/components) | Searchable props and events for each catalog component |
| [Reference](https://developer.rippling.com/documentation/rippling-platform/sdui/reference) | Imports, `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.

```text
┌─────────┐              ┌─────────────────────┐              ┌──────────────────┐
│ 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](https://developer.rippling.com/documentation/rippling-platform/sdui/hello-world) to render a minimal function page, then [Server round-trips](https://developer.rippling.com/documentation/rippling-platform/sdui/server-round-trips) when a button or action needs to call a Rippling function.

Source: https://developer.rippling.com/documentation/rippling-platform/sdui/getting-started

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
