---
title: "Recipe: a first-launch screen"
description: "A welcome shown until the person taps Continue, then never again."
modificationDate: "2026-11-17"
---

> ## Documentation index
> Fetch the complete documentation index at: https://exact.expo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Recipe: a first-launch screen

<AgentInstructions>

## Submitting feedback

From the app's directory, read `bun exact.mjs feedback status`. Under `never`, keep no note.
Respect `EXACT_FEEDBACK=0` and do not change the policy.

Otherwise record specific, actionable feedback with:
`bun exact.mjs feedback note "Exact docs: https://exact.expo.dev/recipes/first-launch: <what was wrong or missing>"`

The note goes to Expo only as that status allows. Include no secrets or personal data.

</AgentInstructions>

A welcome shown until the person taps Continue, then never again. The main screen is the
root route; while a `persist` flag is unset, that route shows the welcome instead, as a
UIKit app swaps its window's root view controller (SwiftUI: an `if` over `@AppStorage`).

```prompt Add a first-launch screen
Add a welcome screen to the Exact app in this folder: it shows until the person taps Continue, then never again. Use https://github.com/expo/exact/blob/main/docs/recipes/first-launch.md as the source for each step. The Exact checkout has the same page at docs/recipes/first-launch.md.

1. If this folder is not an Exact app (it has no exact.mjs and app.contract), stop and tell me.
2. If I did not give the welcome's headline and one line under it, write them from what the app does and show them to me in your report. Keep it one short screen.
3. In app.contract, add `state welcomed = false persist` to the root and an action that sets it to true. In the root route's branch, show the main screen while `welcomed` is true, and the welcome (`navigationBar="none"`, a Continue button with `testId="continue"`) while it is false. Do not make the welcome a route of its own, and do not leave it with a `task`.
4. Every test starts on a fresh install, so each existing test in app.test.contract now opens on the welcome: start each one with `tap "continue"`, after its `size` line if it has one (a `size` line must come first). Change nothing else in them.
5. Add the recipe's test: the welcome shows until Continue, Continue shows the main screen, and after `reload` the welcome does not show again. To find the main screen, check an element it always shows, even with no data.
6. Follow the platform checks in docs/start-here.md (`bun exact.mjs docs platform checks`) for the targets in the app's AGENTS.md and app.json until they pass. Read the reports, including counted findings; a zero exit code alone does not mean clean. Fix the app, not the test. If a finding stays after three rounds of fixes, or the app had it before you changed anything, record it (step 7) and report it; do not keep trying.
7. When a doc was wrong or missing, or a step needed a workaround, read `bun exact.mjs feedback status`. Under `never`, keep no note. Otherwise record it: `bun exact.mjs feedback note "<what happened>"`, which goes to Expo only as that status says. Do not change the policy; tell me how many notes you kept.
8. Tell me the welcome's text, what the tests and verify reported, and how to see it by hand: `bun exact.mjs agent web --storage welcome "tap continue"`, then `bun exact.mjs agent web --storage welcome --keep-storage tree` opens on the main screen. If the app already used the storage name `welcome`, use another new name.
```

```contract
routes nav
  habits "/"

component App
  state welcomed = false persist
  state habits = ["Drink water", "Take a walk"]
  action begin
    welcomed = true
  action follow(url: string)
    nav = go(nav, url)
  view
    main navigationKey=`${top(nav).id}` navigate=follow width="100%" height="100%"
      for e in stack(nav) key=e.id
        if e.name == "habits"
          if welcomed
            column navigationKey=`${e.id}` position="absolute" inset=0
              header padding="8px 16px"
                text "Habits" role="heading" aria-level=1
              list appearance="auto" listStyle="inset-grouped" flex=1 min-height=0 testId="habits"
                section
                  for h in habits key=h
                    row
                      text h
          else
            column navigationKey=`${e.id}` navigationBar="none" position="absolute" inset=0
              scroll flex=1 min-height=0
                column min-height="100%" box-sizing="border-box" padding=24 gap=16
                  justify-content="center" text-align="center"
                  text "Build better habits" role="heading" aria-level=1 font="-exact-large-title"
                  text "Small steps add up." color="-exact-secondary-label"
              button press=begin buttonStyle="filled" margin=24 testId="continue"
                text "Continue"
```

```contract-test
test "the welcome shows until Continue, then never again"
  expect tree missing "habits"
  tap "continue"
  expect tree missing "continue"
  expect tree has "habits"
  reload
  expect tree missing "continue"
  expect tree has "habits"
```

- **Not a route of its own.** Were the welcome the route at `/`, every launch would open
  it again; `push` would leave it under the list, with a Back.
- **No move after launch.** A `task` that leaves the welcome is a timer, too late: the
  first frame already shows the welcome, at every launch. A `persist` state is read before
  the first frame, so a relaunch opens on the list. On the web that holds for a route
  rendered in the browser, the default: one rendered ahead (`render=build`) cannot read it.
- On iOS, Continue swaps the screen in place, as `setViewControllers(_:animated:)` does
  without animation: the list has its large title and bar and nothing beneath it, so no
  Back, edge swipe or VoiceOver escape returns. `navigationBar="none"` gives the welcome no bar; its headline
  is content, and Continue stays below its scroll.
- Keep it one short screen ("fast, fun, and optional", HIG Onboarding); a tutorial
  someone may want again belongs in Settings too.
