N/A

ChatMessages

Manage chat message lists with scrolling behavior, loading states, and action-ready assistant output.

What is Nuxt?

Nuxt is a Vue.js framework that provides server-side rendering, file-based routing, and a powerful module ecosystem for building modern web applications.

How do I get started?

You can create a new Nuxt project by running `npx nuxi@latest init my-app`. This will scaffold a new project with the recommended configuration.

Installation

pnpm dlx shadcn-vue@latest add "https://ui.stackhacker.io/r/chat-messages.json"

Usage

<script setup lang="ts">
import { ChatMessages } from '@/components/ui/chat-messages'
</script>

<template>
  <ChatMessages :messages="messages" :status="status" should-auto-scroll />
</template>

Examples

Default

What is Nuxt?

Nuxt is a Vue.js framework that provides server-side rendering, file-based routing, and a powerful module ecosystem for building modern web applications.

How do I get started?

You can create a new Nuxt project by running `npx nuxi@latest init my-app`. This will scaffold a new project with the recommended configuration.

API Reference

Props

PropTypeDefaultDescription
messagesUIMessage[][]Array of messages to display.
status'ready' | 'streaming' | 'submitted' | 'error''ready'Current chat status. Shows loading indicator when submitted.
shouldAutoScrollbooleanfalseEnable auto-scroll to bottom on new messages.
assistant{ actions?: ChatMessageAction[] }Assistant-specific configuration (e.g., action buttons).
classstringAdditional CSS classes.

Slots

SlotPropsDescription
content{ message, index, id, role, parts }Custom message content renderer.
indicatorCustom loading indicator (shown when status is submitted).