Aurora ChatMessage
aurora-dinglebear-ai/aurora-chat-messageUnverifiedComponent
Aurora ChatMessage — Claude Design parity.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/dinglebear-ai/aurora/main/aurora-chat-message.jsonSource
1"use client"23import * as React from "react"4import { Copy, Link2, RotateCcw, Shield } from "lucide-react"56import { Button } from "./button"7import { cn } from "@/lib/utils"8import { safeHttpUrl } from "@/registry/aurora/lib/safe-url"910// Styles: registry/aurora/styles/aurora-components.css (@layer aurora-components).1112/* -------------------------------------------------------------------------- */13/* Types */14/* -------------------------------------------------------------------------- */1516export type ChatMessageRole = "user" | "assistant"1718export interface ChatMessageCitation {19 label: string20 href: string21}2223export interface ChatMessageProps extends React.HTMLAttributes<HTMLDivElement> {24 /** Who is speaking. User turns align right; assistant turns align left with an avatar. */25 role: ChatMessageRole26 /** Display name shown in the assistant header. */27 author?: React.ReactNode28 /** Timestamp shown next to the author. */29 time?: React.ReactNode30 /** Source citations rendered as monospace chips below the bubble. */31 citations?: ChatMessageCitation[]32 /** Optional copy handler (reserved for action affordances). */33 onCopy?: () => void34 /** Optional retry handler (reserved for action affordances). */35 onRetry?: () => void36 children?: React.ReactNode37}3839/* -------------------------------------------------------------------------- */40/* Component */41/* -------------------------------------------------------------------------- */4243function ChatMessage(44 {45 role,46 author,47 time,48 citations,49 onCopy,50 onRetry,51 className,52 children,53 ref,54 ...props55 }: ChatMessageProps & { ref?: React.Ref<HTMLDivElement> },56) {57 const isAssistant = role === "assistant"58 const showHead = isAssistant && (author != null || time != null)59 const showActions = isAssistant && (onCopy != null || onRetry != null)6061 return (62 <div63 ref={ref}64 data-role={role}65 className={cn("aurora-chat-message", className)}66 {...props}67 >68 {showHead ? (69 <div className="aurora-chat-message__head">70 <span className="aurora-chat-message__avatar" aria-hidden="true">71 <Shield size={18} strokeWidth={1.7} />72 </span>73 <span className="aurora-chat-message__meta">74 {author != null ? (75// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from aurora
All 176 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Aurora Accordionaurora-accordion | aurora | Components | Unverified | 2 deps | |
| Aurora Alert Dialogaurora-alert-dialog | aurora | Components | Unverified | 2 deps | |
| Aurora Aspect Ratioaurora-aspect-ratio | aurora | Components | Unverified | no deps | |
| Aurora Avataraurora-avatar | aurora | Components | Unverified | 1 dep | |
| Aurora Badgeaurora-badge | aurora | Components | Unverified | 2 deps | |
| Aurora Banneraurora-banner | aurora | Components | Unverified | 1 dep | |
| Aurora Breadcrumbaurora-breadcrumb | aurora | Components | Unverified | 2 deps | |
| Aurora Buttonaurora-button | aurora | Components | Unverified | 2 deps |
