---
title: "Recipe: a mini player above the tab bar"
description: "Name the element with navigationTabAccessory on the root tablist."
modificationDate: "2026-11-22"
---

> ## 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 mini player above the tab bar

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

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

</AgentInstructions>

Name the element with `navigationTabAccessory` on the root tablist. On iOS 26 and
later it is UIKit's tab bar accessory, a glass capsule on every tab that UIKit places
and sizes: on an iPhone above the bar, and inline where the bar was while the bar
hides (48 points high on an iPhone 18 Pro with iOS 27); on an iPad at the bottom of
the page, beside a shown sidebar. The routes clear it. The web, the Mac and Android
show the element where it is written, above the tab strip, at the size it says.

```prompt Add a mini player above the tab bar
Add a mini player to the Exact app in this folder: one element above the tab bar, on every tab. Use https://github.com/expo/exact/blob/main/docs/recipes/mini-player.md as the source for each step. The Exact checkout has the same page at docs/recipes/mini-player.md.

1. If this folder is not an Exact app (it has no exact.mjs and app.contract), stop and tell me.
2. The mini player needs a root `tablist`. If the app has none, stop and tell me: docs/recipes/tabs.md adds one. If I did not say what the mini player shows and when it shows, propose it from the app and ask me before you write code.
3. In app.contract, write the element as a box with an `id`, after every tab panel the tablist links and before the tablist. Keep it outside the tablist, the panels and their routes, the sidebar's `footer`, a popover, a `dialog` and a `list`.
4. Name the element on the root tablist: `navigationTabAccessory="<id>"`. Show and hide the element with `if` or `display`, and name none (`""`) while it is absent.
5. Lay the content out to fit. On iOS 26 and later, UIKit places and sizes the element whatever `height` it says (48 points high on an iPhone 18 Pro with iOS 27), and makes it narrower inline. Leave its background unsaid unless the web needs one: a background you write paints over UIKit's glass. The web, the Mac and Android show the element where it is written, at the size it says.
6. Fix each `lower-tab-accessory` error as its message says. If the app runs on iOS, read `bun exact.mjs agent ios logs` too: a development build writes there the reason the compiler could not prove.
7. Add a test in app.test.contract that taps the mini player's button and expects its change, then taps another tab and expects the mini player there (`expect tree has`).
8. 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 9) and report it; do not keep trying.
9. 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.
10. Tell me what the mini player shows and when, what the tests and checks reported, and the launch command for each target platform. iOS 17 to 25 have no accessory: there the element stays hidden under the shown tab bar, a known gap. Do not work around it.
```

```contract
routes nav
  tab library "/"
  tab search "/search"

component App
  state playing = true
  state paused = false
  action pick(name: string)
    nav = select(nav, name)
  action togglePlay
    paused = not paused
  view
    main navigationKey=`${top(nav).id}` navigationBack="back" display="flex" flex-direction="column"
      column flex=1 min-height=0 position="relative"
        for t in nav.tabs key=t.name
          column role="tabpanel" id=`panel-${t.name}` position="absolute" inset=0
            for e in t.stack key=e.id
              column navigationKey=`${e.id}` position="absolute" inset=0
                header
                  text (t.name == "library" ? "Library" : "Search") role="heading" aria-level=1
      if playing
        row id="now-playing" display="flex" align-items="center" gap=12 padding="0 16px" height=56
          text "Song title" flex=1
          button press=togglePlay aria-label=(paused ? "Play" : "Pause") testId="toggle-play"
            image (paused ? "symbol:play" : "symbol:pause")
      row role="tablist" navigationTabAccessory=(playing ? "now-playing" : "")
        for t in nav.tabs key=t.name
          button role="tab" aria-controls=`panel-${t.name}` aria-selected=(nav.tab == t.name) press=pick(t.name)
            text (t.name == "library" ? "Library" : "Search")
```

- **Place.** Write the element after every tab panel the tablist links, usually just
  before the tablist: outside the tablist, the panels and their routes, the sidebar's
  `footer`, a popover, a `dialog` and a `list`, and as a box, not a run of text, a part
  of an `svg` or a `select`, or a radio or a tab of its group.
- **Size.** On iOS the element's box is the accessory's whatever `height` it says, and
  narrower inline: lay its content out to fit. A background you write paints over
  UIKit's glass there, so leave it unsaid unless the web needs one.
- **Show and hide** it with `if` or `display`, and name none (`""`) while it is absent,
  as the example does, so a development build notes nothing.
- **Errors.** Where the compiler can prove it, a literal id that names nothing, or an
  element in a place **Place** rules out, is an error (`lower-tab-accessory`) whose
  message says what to change. Otherwise, on iOS 26 and later while Exact's own tab
  container shows the tabs, a development build writes the reason to `logs`. iOS 17
  to 25 have no accessory: there the element stays where it is written, hidden under
  the shown tab bar (a known gap, QUEUE.md).
