# File preview

> What happens when you tap a file in a chat: most files open in Quick Look on iPhone and iPad; videos, audio, Markdown and theme files go elsewhere.

Source: https://air.build/docs/screens/chat/file-preview/

> [!NOTE]
> Quick Look is on iPhone and iPad. On Mac, a file opens in the app your Mac uses for that type instead (see [On Mac](https://air.build/docs/screens/chat/file-preview/#on-mac)).

File preview is the full-screen Quick Look preview a file in a chat opens in on iPhone and iPad: PDFs, documents, text, spreadsheets and any other file the system can show. Some kinds of file open somewhere else, listed below.

## Open it

Tap a file in a message. If the file isn't on this device yet, it downloads first and its row shows the progress; the preview opens when the download is done. A file downloaded before opens at once.

The preview grows out of the file you tapped and closes back into it.

## Where each kind of file opens

| File | What a tap does |
| --- | --- |
| A video (any video type) | Opens the [video player](https://air.build/docs/screens/chat/video-player/). |
| Audio, such as a voice note | Plays in the message itself; no preview opens. Tap again to pause, and again to go on. Starting another one stops the first. At the end it rewinds, so the next tap plays it from the start. If it fails to load, the next tap tries again. |
| Markdown (`.md`, `.markdown`, or sent as Markdown) | Opens in AirBuild's own document reader, in a tab. Where there is no place for a tab, it opens in Quick Look like other files. |
| An AirBuild theme (`.airtheme`) | Shows in the chat as a theme card: a small picture of a chat in the theme, its name, and **Theme** with its appearance (for example "Theme · Dark"; the appearance is **Light**, **Dark** or **Follows System**; until the card has read the file, just "Theme"). The card's button reads **Apply** (wears the theme in one tap), **Update** (you have an older version), **Applying…**, or **In Use**. A file that can't be opened reads "Can’t open this theme" and has no button. Tapping the card itself downloads it under a **Downloading Theme** alert, then offers to apply or export it. See [Theme files](https://air.build/docs/screens/chat/file-preview/#theme-files). |
| Pictures | Pictures shown in the message open in the [image viewer](https://air.build/docs/screens/chat/image-viewer/). |
| Anything else | iPhone and iPad: Quick Look. Mac: the app your Mac uses for that type. |

## What's on it

The preview is iOS's Quick Look: its buttons, such as closing the preview and sharing the file, are the system's own. What it can show depends on the file type.

Other things to do with a file (save it, open it in another app, copy it) are in the file's menu in the chat; see [Conversation](https://air.build/docs/screens/chat/conversation/).

## Theme files

1. Tap the theme card (not its button). An alert **Downloading Theme** shows the file name while it downloads. **Cancel** stops the download. A theme already downloaded skips this step.
2. An alert with the theme's name asks: "Apply this theme now, or export the file to keep a copy."
3. Tap **Apply** to use the theme now, **Export** to save the file where you choose, or **Cancel**.

More in [Apply a theme from a chat](https://air.build/docs/projects/customize-with-themes/#apply-a-theme-from-a-chat).

## On Mac

Clicking a file that isn't a video, audio, Markdown or theme file downloads it and opens it in the app your Mac uses for that type, the way a downloaded file opens. Files that would run something when opened, such as scripts, installers, Terminal files and web locations, aren't opened: Finder shows them instead, so running one is your own double-click under the Mac's usual safety prompts.

## Messages

| Message | When | What to do |
| --- | --- | --- |
| **Downloading Theme** (with the file name) | A theme file is downloading. | Wait, or tap **Cancel**. |
| **Couldn't Open Theme**: "This file isn't a theme AirBuild can use." | The file isn't a theme file this version can read. | Tap **OK**. Ask whoever sent it to send it again. |
| **Couldn't Open Theme**: "This theme needs a newer version of AirBuild." | The theme was made for a later version of the app. | Tap **OK** and update AirBuild. |
| **Couldn't Open Theme**: "This theme has the same name as one that comes with AirBuild." | The theme would replace one built into the app, so it can't be added. | Tap **OK**. |
| **Couldn't Open Theme**: "The file couldn’t be downloaded. Try again." | The theme file hadn't arrived on this device. | Tap **OK** and try again. |
| "Can’t open this theme" (on the theme card) | The card couldn't read the file. The card has no button. | Ask whoever sent it to send it again. |
| **Couldn’t Open File**: "This file couldn’t be prepared for the Mac’s safety checks, so it wasn’t opened." | Mac only: the file couldn't be marked for the Mac's safety checks, so AirBuild didn't open it. | Click **OK**. Some files are still shown in Finder. |

If a file fails to download, the row stops showing progress and nothing opens. Tap it again to try once more. A theme file that fails to download closes the **Downloading Theme** alert and nothing else shows; tap the card again.
