Files
supabase/apps/ui-library/content/docs/react/realtime-avatar-stack.mdx
Ivan Vasilov 156e8fd9b7 fix: Minor fixes for UI Library (#34535)
* Regenerate the registry.

* Fix the paths of the ai editor rules.

* Fix headings on clients and auth blocks.

* Fix realtime chat and avatar demos.

* Setup mdx-lint for the ui-library. Fix some obvious wordings.

* Fix the tooltips for the examples. Reorder the example pages.
2025-03-30 09:56:03 +02:00

41 lines
1.2 KiB
Plaintext

---
title: Realtime Avatar Stack
description: Avatar stack in realtime
---
<BlockPreview name="realtime-avatar-stack-demo" />
## Installation
<BlockItem
name="realtime-avatar-stack-react"
description="Renders a stack of avatars which are connected via Supabase Realtime"
/>
## Folder structure
<RegistryBlock itemName="realtime-avatar-stack-react" />
## Usage
The `RealtimeAvatarStack` component renders stacked avatars which are connected to Supabase Realtime. It uses the Presence feature of Supabase Realtime. You can use this to show currently online users in a chatroom, game session or collaborative app.
```tsx
import { RealtimeAvatarStack } from '@/components/realtime-avatar-stack'
export default function Page() {
return (
<Header className="flex items-center justify-between">
<h1>Lumon Industries</h1>
<RealtimeAvatarStack roomName="break_room" />
</Header>
)
}
```
## Props
| Prop | Type | Default | Description |
| ---------- | -------- | ------- | ---------------------------------------------------- |
| `roomName` | `string` | `null` | The name of the Supabase Realtime room to connect to |