Documentation

Camera

Design a camera view with front/back switching, zoom, flash, and aspect ratio — and wire captures into your data

2 min read

Place a Camera component on a screen and a real camera preview appears right there. Like a shipped camera app, it has front/back switching, zoom, flash, and aspect ratio — and captured photos flow into your data, ready to connect to the rest of your app.

Camera settings

Set the camera's initial state in the Inspector.

  • Position — front / back
  • Aspect Ratio — 4:3 · 1:1 · 16:9. The preview and the captured photo share the same ratio.
  • Flash — off / auto / on
  • Zoom — magnification

All of these can be bound to data. Position, aspect ratio, and flash ship as built-in enums, so you can build switching UI in seconds with enum-bound controls (menus, Segmented Controls, and more). Values changed at runtime are written back to the bound data.

The Camera action

Control the camera with the Camera Control action in an Action Flow.

  • Take Photo — captures a photo. The resulting image can be:
    • saved into an image data field to show in an Image view or send to an API,
    • saved straight to the Photos app.
    • The captured image is also the action's output, so following actions (apply a filter, share, …) can use it directly.
  • Toggle Camera — switches front/back.
  • Start / Stop — turns the camera session on and off.

Front-camera captures are saved exactly as the preview showed them (mirrored).

Permission

The camera needs the user's permission. Without it, the camera view shows a notice with an Open Settings shortcut. The camera also works in iPad multitasking (Split View and friends).

Capture → save into image data → append to an array bound to a List — three actions and you have your own gallery app. Add a filter and it's a filter camera. Open the Filter Camera template in the gallery for a finished example.