BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Supabase Library/realtime-chat-react

Realtime Chat

supabase-library/realtime-chat-react
FreeComponent

Component which renders realtime chat messages from other users in a room.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/supabase/supabase/master/apps/ui-library/public/r/realtime-chat-react.json

Source

registry/default/blocks/realtime-chat/components/chat-message.tsxraw.githubusercontent.com/supabase/supabase/master/apps/ui-library/public/r/realtime-chat-react.json
1import { cn } from '@/lib/utils'
2import type { ChatMessage } from '@/registry/default/blocks/realtime-chat/hooks/use-realtime-chat'
3
4interface ChatMessageItemProps {
5 message: ChatMessage
6 isOwnMessage: boolean
7 showHeader: boolean
8}
9
10export const ChatMessageItem = ({ message, isOwnMessage, showHeader }: ChatMessageItemProps) => {
11 return (
12 <div className={`flex mt-2 ${isOwnMessage ? 'justify-end' : 'justify-start'}`}>
13 <div
14 className={cn('max-w-[75%] w-fit flex flex-col gap-1', {
15 'items-end': isOwnMessage,
16 })}
17 >
18 {showHeader && (
19 <div
20 className={cn('flex items-center gap-2 text-xs px-3', {
21 'justify-end flex-row-reverse': isOwnMessage,
22 })}
23 >
24 <span className={'font-medium'}>{message.user.name}</span>
25 <span className="text-foreground/50 text-xs">
26 {new Date(message.createdAt).toLocaleTimeString('en-US', {
27 hour: '2-digit',
28 minute: '2-digit',
29 hour12: true,
30 })}
31 </span>
32 </div>
33 )}
34 <div
35 className={cn(
36 'py-2 px-3 rounded-xl text-sm w-fit',
37 isOwnMessage ? 'bg-primary text-primary-foreground' : 'bg-muted text-foreground'
38 )}
39 >
40 {message.content}
41 </div>
42 </div>
43 </div>
44 )
45}

What it pulls in

npm packages

  • lucide-react
  • @supabase/supabase-js@latest

Other registry items

  • input
  • button

Files it writes

  • registry/default/blocks/realtime-chat/components/chat-message.tsx
  • registry/default/blocks/realtime-chat/components/realtime-chat.tsx
  • registry/default/blocks/realtime-chat/hooks/use-realtime-chat.tsx
  • registry/default/blocks/realtime-chat/hooks/use-chat-scroll.tsx
  • registry/default/clients/react/lib/supabase/client.ts

Facts

Registry
Supabase Library
Type
registry:component
Access
Free
Files written
5
Licence
Apache-2.0
First indexed
2026-08-11
Last confirmed
today

Go to the source

supabase.com supabase/supabase on GitHub Raw registry item This item as JSON

More from Supabase Library

All 60 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Current User Avatarcurrent-user-avatar-nextjsSupabase LibraryComponentsFree2 deps · 6 files
Current User Avatarcurrent-user-avatar-reactSupabase LibraryComponentsFree1 dep · 4 files
Current User Avatarcurrent-user-avatar-react-routerSupabase LibraryComponentsFree2 deps · 5 files
Current User Avatarcurrent-user-avatar-tanstackSupabase LibraryComponentsFree2 deps · 5 files
Dropzone (File Upload)dropzone-nextjsSupabase LibraryComponentsFree4 deps · 5 files
Dropzone (File Upload)dropzone-reactSupabase LibraryComponentsFree3 deps · 3 files
Dropzone (File Upload)dropzone-react-routerSupabase LibraryComponentsFree4 deps · 4 files
Dropzone (File Upload)dropzone-tanstackSupabase LibraryComponentsFree4 deps · 4 files
BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex