conversation
elevenlabs/conversationFreeComponent
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/conversation.jsonSource
1"use client"23import type { ComponentProps } from "react"4import { useCallback } from "react"5import { ArrowDownIcon } from "lucide-react"6import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom"78import { cn } from "@/lib/utils"9import { Button } from "@/components/ui/button"1011export type ConversationProps = ComponentProps<typeof StickToBottom>1213export const Conversation = ({ className, ...props }: ConversationProps) => (14 <StickToBottom15 className={cn("relative flex-1 overflow-y-auto", className)}16 initial="smooth"17 resize="smooth"18 role="log"19 {...props}20 />21)2223export type ConversationContentProps = ComponentProps<24 typeof StickToBottom.Content25>2627export const ConversationContent = ({28 className,29 ...props30}: ConversationContentProps) => (31 <StickToBottom.Content className={cn("p-4", className)} {...props} />32)3334export type ConversationEmptyStateProps = Omit<35 ComponentProps<"div">,36 "title"37> & {38 title?: React.ReactNode39 description?: React.ReactNode40 icon?: React.ReactNode41}4243export const ConversationEmptyState = ({44 className,45 title = "No messages yet",46 description = "Start a conversation to see messages here",47 icon,48 children,49 ...props50}: ConversationEmptyStateProps) => (51 <div52 className={cn(53 "flex size-full flex-col items-center justify-center gap-3 p-8 text-center",54 className55 )}56 {...props}57 >58 {children ?? (59 <>60 {icon && <div className="text-muted-foreground">{icon}</div>}61 <div className="space-y-1">62 <h3 className="text-sm font-medium">{title}</h3>63 {description && (64 <p className="text-muted-foreground text-sm">{description}</p>65 )}66 </div>67 </>68 )}69 </div>70)7172export type ConversationScrollButtonProps = ComponentProps<typeof Button>7374export const ConversationScrollButton = ({75 className,76 ...props77}: ConversationScrollButtonProps) => {78 const { isAtBottom, scrollToBottom } = useStickToBottomContext()7980 const handleScrollToBottom = useCallback(() => {81 scrollToBottom()82 }, [scrollToBottom])8384 return (85 !isAtBottom && (86 <Button87 className={cn(88 "bg-background dark:bg-background absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full shadow-md",89 className90 )}91 onClick={handleScrollToBottom}92 size="icon"93 type="button"94 variant="outline"95 {...props}96 >97 <ArrowDownIcon className="size-4" />98// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from shadcn/ui
All 50 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| audio-playeraudio-player | shadcn/ui | Components | Free | 2 deps | |
| bar-visualizerbar-visualizer | shadcn/ui | Components | Free | no deps | |
| conversation-barconversation-bar | shadcn/ui | Components | Free | 1 dep | |
| live-waveformlive-waveform | shadcn/ui | Components | Free | no deps | |
| matrixmatrix | shadcn/ui | Components | Free | no deps | |
| messagemessage | shadcn/ui | Components | Free | 1 dep | |
| mic-selectormic-selector | shadcn/ui | Components | Free | no deps | |
| orborb | shadcn/ui | Components | Free | 4 deps |
