The component that displays your character and animates its mouth as it speaks.
<Avatar /> renders the character and keeps it in sync with the session —
loading, connection status, captions, and lip-sync are all handled for you. It
reads everything it needs from the nearest AvatarProvider, so it takes no
required props.
Place it anywhere inside AvatarProvider. Always give its parent a width and
height — the avatar fills its container, so without a size it is invisible.
Always wrap <Avatar /> in a sized container. The canvas reads its pixel
dimensions from the parent. Without explicit width and height it renders at
zero size. This is the most common setup mistake.
| Prop | Type | Default | Description |
|---|---|---|---|
classNameOptional | string | No default | CSS class on the avatar container. |
styleOptional | React.CSSProperties | No default | Inline styles on the avatar container. |
loaderOptional | React.ReactNode | No default | Shown while the avatar is resolving, and again during connect. Defaults to the SDK's animated orb; pass null to render nothing. |
errorFallbackOptional | React.ReactNode | No default | Shown when the avatar failed to load at all. A session that ends after the avatar is painted keeps the avatar, so it never reaches this. |
fitOptional | string | No default | Overrides the fit the avatar was published with — "contain", "cover", "fill", "fitWidth", "fitHeight", "scaleDown", "layout", "none". Leave unset to use the published value. |
Only relevant when perception.camera is enabled — see
Camera perception.
| Prop | Type | Default | Description |
|---|---|---|---|
cameraPreviewCornerOptional | CameraPreviewCorner | "bottom-right" | Where the self-view sits while a camera session is open. Ignored in picture-in-picture. |
hideCameraPreviewOptional | boolean | false | Hide the self-view. Discouraged — it is how the user sees that their camera is on, and capture continues regardless. Ignored in picture-in-picture. |
usePictureInPictureOptional | boolean | false | Camera on the stage, avatar in the corner, once a camera session opens. Takes precedence over the two props above. |
pictureInPictureCornerOptional | CameraPreviewCorner | "bottom-right" | The avatar's corner in picture-in-picture. Independent of cameraPreviewCorner, since the two modes place different things. |
Each built-in overlay takes a class and a style, so you can restyle it without reaching into the SDK's CSS.
| Prop | Type | Default | Description |
|---|---|---|---|
captionClassNameOptional | string | No default | Class on the caption overlay. Shown when transcript.captions is on. |
captionStyleOptional | React.CSSProperties | No default | Inline styles on the caption overlay. |
statusBannerClassNameOptional | string | No default | Class on the connectivity banner. Shown when statusBanner.enabled is on. |
statusBannerStyleOptional | React.CSSProperties | No default | Inline styles on the connectivity banner. |
thinkingIndicatorClassNameOptional | string | No default | Class on the thinking indicator. Shown unless thinkingIndicator.enabled is false. |
thinkingIndicatorStyleOptional | React.CSSProperties | No default | Inline styles on the thinking indicator. |
Whether an overlay exists at all is a provider decision
(transcript, statusBanner, thinkingIndicator); how it looks is an
Avatar prop. Enabling and styling are deliberately separate.
Layers are conditional — a bare <Avatar /> with default config renders only
the canvas and the connectivity dot.
| Layer | Shown when | What it is |
|---|---|---|
| Rive canvas | Always | The animated character, lip-synced from character-level alignment data. |
| Connectivity dot | Always | A small indicator: green connected, red disconnected. Styleable with CSS. |
| Connecting overlay | While connecting | Your loader, or the SDK's animated orb. |
| Captions | transcript.captions | The live caption overlay, at the configured anchor. |
| Status banner | statusBanner.enabled | Connectivity warnings, driven by live stream health. Appears only when something is wrong. |
| Thinking indicator | thinkingIndicator.enabled | Animated dots, shown only while a turn is running unusually slow. |
| Controls bar | controls.enabled, call mode | Start / stop, mic and speaker mute, and — with controls.stopSpeaking — an interrupt button. Swaps to a hold-to-talk bar in push-to-talk mode. |
| Camera self-view | perception.camera, camera open | The user's own camera preview, in the configured corner. |
Pass loader={null} to render nothing during loading.
The SDK's own loader is exported if you want it somewhere else, or with different copy:
It sizes itself from a container query, so the same node works in a 64px bubble and a full-bleed stage.
<Avatar> decides when to show this by checking whether an avatar is actually
on screen — not by looking at the error code — so it stays right whichever error
fired and whenever it fired. If you do nothing, it renders a built-in card, so
you never ship a blank frame. See
Error Handling.
fit="cover" crops the artboard to fill the frame — that is what reads as
"zoomed in" on a wide hero. fit="contain" keeps the whole character visible.
Leave fit unset to respect whatever the avatar was published with.
The dot is a DOM element with stable class names:
Colour alone is not an accessible status signal. If connection state matters to your users, pair the dot with a text label or an icon rather than relying on green-versus-red.