Files
supabase/apps/ui-library/content/docs/vue/realtime-avatar-stack.mdx
Katerina Skroumpelou 77e5180c5c chore: format files (#43668)
Format files. Run `pnpm format` at root.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-03-11 18:40:01 +00:00

50 lines
1.5 KiB
Plaintext

---
title: Realtime Avatar Stack
description: Avatar stack in realtime
---
<BlockPreview name="realtime-avatar-stack-demo" />
## Installation
<BlockItem
name="realtime-avatar-stack-vue"
description="Renders a stack of avatars which are connected via Supabase Realtime"
/>
## Folder structure
This block assumes that you have already installed a Supabase client for Vue from the previous step.
<RegistryBlock itemName="realtime-avatar-stack-vue" />
## 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.
```vue
<script setup lang="ts">
// Assumes you have Header component created
import Header from '@/components/Header.vue'
import RealtimeAvatarStack from '@/components/RealtimeAvatarStack.vue'
</script>
<template>
<Header class="flex items-center justify-between">
<h1>Lumon Industries</h1>
<RealtimeAvatarStack roomName="break_room" />
</Header>
</template>
```
## Props
| Prop | Type | Default | Description |
| ---------- | -------- | ------- | ---------------------------------------------------- |
| `roomName` | `string` | `null` | The name of the Supabase Realtime room to connect to |
## Further reading
- [Realtime Presence](https://supabase.com/docs/guides/realtime/presence)
- [Realtime authorization](https://supabase.com/docs/guides/realtime/authorization)