---
title: "Recipe: columns that wrap on a phone"
description: "Columns side by side when wide and stacked on a phone: flex items that wrap at a minimum width, as in CSS."
modificationDate: "2026-11-01"
---

> ## 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: columns that wrap on a phone

<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/responsive-columns: <what was wrong or missing>"`

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

</AgentInstructions>

Columns side by side when wide, stacked on a phone, and a title and button that
restack at the largest text size: flex items that wrap at a minimum width, as in CSS.

```prompt Make my columns wrap on a phone
Make the columns in the Exact app in this folder sit side by side on a wide window and stack on a phone. Use https://github.com/expo/exact/blob/main/docs/recipes/responsive-columns.md as the source for each step. The Exact checkout has the same page at docs/recipes/responsive-columns.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 name the screen, find the one with columns side by side and ask me before you write code.
3. In app.contract, put the columns in a `row flex-wrap="wrap"` and give each column `flex="1 1 280px" min-width=0`, or a basis that fits its content. Never squeeze columns to fit; columns that scroll sideways are a `scroll overflow-x="scroll"` of fixed-width columns. A list beside its detail is `bun exact.mjs pattern list-detail`.
4. A title and a button on one line: wrap their row too, and give the title `flex="1 1 12rem"`, so the button moves under the title at the largest text size.
5. Add tests in app.test.contract: one with `size 1000x700` and one with `size 390x844`, each expecting every column (`expect tree has "<column id>"`).
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 screen, the column widths, what the tests and checks reported, and the launch command for each target platform.
```

```contract
shape Task
  id: string
  title: string
  column: string

component Board
  state tasks = [Task(id="1", title="Write the brief", column="todo"), Task(id="2", title="Review the plan", column="doing")]
  action add()
    tasks = tasks.concat([Task(id="3", title="New", column="todo")])
  view
    scroll height="100%"
      row flex-wrap="wrap" align-items="center" gap=8 padding=16
        text "Sprint 12" role="heading" flex="1 1 12rem"
        button press=add() buttonStyle="bordered" testId="add-task"
          text "Add task"
      row flex-wrap="wrap" align-items="flex-start" gap=16 padding=16
        for col in ["todo", "doing", "done"] key=col
          column flex="1 1 280px" min-width=0 gap=8 testId=`column-${col}`
            text (col == "todo" ? "To Do" : col == "doing" ? "Doing" : "Done") role="heading" aria-level=3
            for c in tasks.filter(x => x.column == col) key=c.id
              text c.title padding-top=6 padding-bottom=6 testId=`task-${c.id}`
```

```contract-test
test "three columns sit side by side on a wide window"
  size 1000x700
  expect tree has "column-done"

test "they stack on a phone"
  size 390x844
  expect tree has "column-done"
```

- `flex="1 1 280px"`: as many 280-point columns as fit share the width; a phone
  shows one per line. Else read `exactViewport`'s `width`.
- A list beside its detail when wide: `pattern list-detail`.
- Sideways on a phone: a `scroll overflow-x="scroll"` of fixed-width columns, never
  squeezed ones.
- `flex="1 1 12rem"`: a `rem` basis grows with the text size, so at the largest the
  button wraps under the title (`verify ios` reports what spills there).

## Paging columns

A masonry has no collection edges: `reachstart` and `reachend` are
refused. Put one `intersect=` marker after the columns, inside their scroller:

```contract
component Feed
  state cards = [0, 1, 2]
  action loadMore(entry: IntersectionObserverEntry)
    if entry.isIntersecting and cards.length < 12
      let next = cards.length
      cards = cards.concat([next, next + 1, next + 2])
  view
    scroll height="100%"
      row align-items="flex-start" gap=16
        for col in [0, 1, 2] key=col
          column flex=1 min-width=0 gap=8
            for card in cards.filter(n => n % 3 == col) key=card
              text `Card ${card + 1}` padding=16 testId=`card-${card}`
      if cards.length < 12
        for boundary in [cards.length] key=boundary
          view intersect=loadMore intersect-margin="0px 0px 800px 0px"
            height=1 testId="load-more"
```

Ignore leave notifications; remount the keyed marker after appending to fill a
short page. Remove it at the end. A server feed also skips while a request is
pending and rekeys only after appending its answer.
[Delivery rules](https://exact.expo.dev/reference/developer/interactive-stress-examples.md#intersection-visibility).
