BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn/ui/message

message

elevenlabs/message
FreeComponent

shadcn/ui publishes no description for this item.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/elevenlabs/ui/main/apps/www/public/r/message.json

Source

components/ui/message.tsxraw.githubusercontent.com/elevenlabs/ui/main/apps/www/public/r/message.json
1import type { ComponentProps, HTMLAttributes } from "react"
2import { cva, type VariantProps } from "class-variance-authority"
3
4import { cn } from "@/lib/utils"
5import {
6 Avatar,
7 AvatarFallback,
8 AvatarImage,
9} from "@/components/ui/avatar"
10
11export type MessageProps = HTMLAttributes<HTMLDivElement> & {
12 from: "user" | "assistant"
13}
14
15export const Message = ({ className, from, ...props }: MessageProps) => (
16 <div
17 className={cn(
18 "group flex w-full items-end justify-end gap-2 py-4",
19 from === "user" ? "is-user" : "is-assistant flex-row-reverse justify-end",
20 className
21 )}
22 {...props}
23 />
24)
25
26const messageContentVariants = cva(
27 "is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",
28 {
29 variants: {
30 variant: {
31 contained: [
32 "max-w-[80%] px-4 py-3",
33 "group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground",
34 "group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground",
35 ],
36 flat: [
37 "group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground",
38 "group-[.is-assistant]:text-foreground",
39 ],
40 },
41 },
42 defaultVariants: {
43 variant: "contained",
44 },
45 }
46)
47
48export type MessageContentProps = HTMLAttributes<HTMLDivElement> &
49 VariantProps<typeof messageContentVariants>
50
51export const MessageContent = ({
52 children,
53 className,
54 variant,
55 ...props
56}: MessageContentProps) => (
57 <div
58 className={cn(messageContentVariants({ variant, className }))}
59 {...props}
60 >
61 {children}
62 </div>
63)
64
65export type MessageAvatarProps = ComponentProps<typeof Avatar> & {
66 src: string
67 name?: string
68}
69
70export const MessageAvatar = ({
71 src,
72 name,
73 className,
74 ...props
75}: MessageAvatarProps) => (
76 <Avatar className={cn("ring-border size-8 ring-1", className)} {...props}>
77 <AvatarImage alt="" className="mt-0 mb-0" src={src} />
78 <AvatarFallback>{name?.slice(0, 2) || "ME"}</AvatarFallback>
79 </Avatar>
80)

What it pulls in

npm packages

  • class-variance-authority

Other registry items

  • avatar

Files it writes

  • registry/elevenlabs-ui/ui/message.tsx

Facts

Registry
shadcn/ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
today

Go to the source

ui.elevenlabs.io elevenlabs/ui on GitHub Raw registry item This item as JSON

More from shadcn/ui

All 50 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
audio-playeraudio-playershadcn/uiComponentsFree2 deps
bar-visualizerbar-visualizershadcn/uiComponentsFreeno deps
conversationconversationshadcn/uiComponentsFree1 dep
conversation-barconversation-barshadcn/uiComponentsFree1 dep
live-waveformlive-waveformshadcn/uiComponentsFreeno deps
matrixmatrixshadcn/uiComponentsFreeno deps
mic-selectormic-selectorshadcn/uiComponentsFreeno deps
orborbshadcn/uiComponentsFree4 deps
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