Skip to main content

Interface: WebcamOptions

Configuration options for the Webcam component.

Extends​

Properties​

PropertyTypeDescription
align?Align-
background?stringOptional background fill color behind the video. Defaults to var(--sr-surface-subtle, #1e293b).
blur?numberBlur in virtual pixels (default: 0).
brightness?numberBrightness multiplier (default: 1).
className?string-
color?stringForeground CSS color (default: component/theme color).
customPositioned?booleanWhether this element manages its own CSS transform / positioning (disables stage translate3d).
cycleOnClick?booleanDouble-click webcam to cycle through connected cameras. Defaults to true.
deviceId?stringExplicit device ID or camera label substring.
enterDelay?numberDelay in seconds before entering scene transition begins.
enterDuration?numberDuration in seconds for entering scene transition.
exitDelay?numberDelay in seconds before exiting scene transition begins.
exitDuration?numberDuration in seconds for exiting scene transition.
facingMode?"user" | "environment"Camera orientation: "user" (front selfie)
fit?ImageFitSizing fit: "cover" (default, ideal for round avatars)
height?SizeHeight in stage units or CSS length (default: content size).
id?string-
idealHeight?numberIdeal video capture height in pixels. Defaults to 720.
idealWidth?numberIdeal video capture width in pixels. Defaults to 1280.
mirror?booleanMirror horizontally so presenter movement feels natural. Defaults to true for "user" camera.
onActivate?() => void-
onDeactivate?() => void-
onMount?() => void-
onUnmount?() => void-
opacity?numberWhole-element opacity from 0 to 1 (default: 1).
origin?ElementAnchorWhich point of the element sits on its coordinate (default: "top-left").
position?Position-
rotation?numberRotation in degrees (default: 0).
scale?numberScale multiplier (default: 1).
size?SizeBoth dimensions in stage units or CSS length (default: unset).
style?Properties<0 | string & object, string & object>-
theme?Partial<ThemeConfig>-
width?SizeWidth in stage units or CSS length (default: content size).
x?PositionCoordHorizontal position in stage units (default: 0).
y?PositionCoordVertical position in stage units (default: 0).