BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Supabase UI Library/realtime-chat-react-router

Realtime Chat

supabase-ui-library/realtime-chat-react-router
UnverifiedComponent

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

Install it

npx shadcn@latest add https://raw.githubusercontent.com/aimultiple-benchmark/supabase-bench-cr-2/main/apps/ui-library/public/r/realtime-chat-react-router.json

Source

registry/default/blocks/realtime-chat/components/chat-message.tsxraw.githubusercontent.com/aimultiple-benchmark/supabase-bench-cr-2/main/apps/ui-library/public/r/realtime-chat-react-router.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/ssr@latest
  • @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-router/lib/supabase/client.ts
  • registry/default/clients/react-router/lib/supabase/server.ts

Facts

Registry
Supabase UI Library
Type
registry:component
Access
Unverified
Files written
6
Licence
Apache-2.0
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

supabase.com aimultiple-benchmark/supabase-bench-cr-2 on GitHub Raw registry item This item as JSON

More from Supabase UI Library

All 37 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Current User Avatarcurrent-user-avatar-nextjsSupabase UI LibraryComponentsUnverified2 deps · 6 files
Current User Avatarcurrent-user-avatar-reactSupabase UI LibraryComponentsUnverified1 dep · 4 files
Current User Avatarcurrent-user-avatar-react-routerSupabase UI LibraryComponentsUnverified2 deps · 5 files
Current User Avatarcurrent-user-avatar-tanstackSupabase UI LibraryComponentsUnverified2 deps · 5 files
Dropzone (File Upload)dropzone-nextjsSupabase UI LibraryComponentsUnverified4 deps · 5 files
Dropzone (File Upload)dropzone-reactSupabase UI LibraryComponentsUnverified3 deps · 3 files
Dropzone (File Upload)dropzone-react-routerSupabase UI LibraryComponentsUnverified4 deps · 4 files
Dropzone (File Upload)dropzone-tanstackSupabase UI LibraryComponentsUnverified4 deps · 4 files
BlockDex

Built by

Kynth Studio

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 Studio

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 Studio

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