A robot's live camera over a native video the app feeds (a WebRTC stream or a URL): Live with the latency, Stalled with the last frame's time when frames stop, Paused while the view is frozen here, connecting, offline and no-camera states; pause view, snapshot, mute and full screen; overlays drawn over the picture.
Front camera · Patrol dog 7F3A
Connecting
Connecting to camera…
Camera feed live
npx shadcn add @syncrobotic/camera-feed Also installs: lucide-react, @syncrobotic/cn, @syncrobotic/button, @syncrobotic/spinner, @syncrobotic/skeleton, @syncrobotic/status-glyph
Overview
When to use
- The camera panel of a robot's page or a teleoperation screen.
- A wall of a site's cameras, one feed per robot.
- Watching a robot's view with its detections drawn over it.
Use something else
- A recording with an end, an incident clip: Media player.
- One still frame with what a model saw in it: Annotated image.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Front camera · Forklift 2
Connecting
Connecting to camera…
Camera feed with overlay
Front camera · Patrol dog 7F3A
Connecting
Connecting to camera…
Camera feed connecting
Front camera · Patrol dog 7F3A
Connecting
Connecting to camera…
Camera feed stalled
Front camera · Patrol dog 7F3A
Camera offline
Camera offlineThe robot is out of network range.
Camera feed offline
Rear camera · Delivery bot 3
No camera
No camera
Camera feed no camera
Usage rules
- For a live camera. A recording with an end is
media-player. - The app owns the connection (WebRTC, a gateway, a live URL); pass the
streamorsrcand say what the connection is doing instatus. The feed tells Live from Stalled by itself, from the frames. - Give
labelthe camera andsourcethe robot ("Front camera", "Patrol dog 7F3A"): the header writes both, and they name the feed for screen readers. - Pass
latencyMswhenever you measure it: an operator driving from the picture needs to know how old it is. - Never hide a frozen picture: keep
staleAfterMsat its 2 s default, shorter for teleoperation, longer only for a camera that sends a frame every few seconds. - Overlays (
children) are drawn in the video box's own coordinates; they hide while there is no picture, so a box never floats over a skeleton. - Offer Reconnect (
onRetry) only when reconnecting can help, and say why it is offline inofflineReasonwhen you know.
Changelog
- 0.23.12026-11-21A new source resets the feed's state in the render that brings it instead of an effect later, and the frame callbacks' ref is updated after commit, so it is safe under the React Compiler.
- 0.23.02026-11-20First release: CameraFeed (label, source, stream or src, status, latencyMs, staleAfterMs, offlineReason, onRetry, onSnapshot, audio, aspectRatio, children, labels) over a native <video> the app feeds. The header says the camera, the robot and the state by shape and word: Live with the latency, Connecting (blue spinner), Stalled · last frame 14:02:31 over a dimmed picture after staleAfterMs without a frame (requestVideoFrameCallback, else timeupdate), Paused, Camera offline with an optional Reconnect, No camera. Pause view, snapshot (PNG), mute only with audio, full screen; Space and F while focus is inside. Overlays in a layer over the picture; aspectRatio holds the layout before the first frame. No streaming library.