Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
56d150d
chore(github): deduplicate issue templates
benjamincanac Aug 6, 2025
8a91614
chore(github): update workflows to use `v4` branch
benjamincanac Aug 6, 2025
9bf27c7
chore(readme): update branch to `v4`
benjamincanac Aug 6, 2025
5fbed1f
chore(renovate): update branch to `v4`
benjamincanac Aug 6, 2025
47001ba
docs: update branch to `v4`
benjamincanac Aug 6, 2025
060889e
chore: reorganize under `playgrounds/`
benjamincanac Aug 6, 2025
aef434a
feat: import `@nuxt/ui-pro` components
benjamincanac Aug 6, 2025
b689a75
chore(github): remove `nuxt-ui-pro` job
benjamincanac Aug 7, 2025
ae7b57c
chore(deps): update lockfile
benjamincanac Aug 7, 2025
a8f8a44
fix(locale): clean
benjamincanac Aug 7, 2025
7133107
docs(app): remove `@nuxt/ui-pro` imports
benjamincanac Aug 7, 2025
7615cbc
chore(readme): remove nuxt ui pro mention
benjamincanac Aug 7, 2025
ed33da7
docs: remove pro source
benjamincanac Aug 7, 2025
b124078
docs: add redirects
benjamincanac Aug 7, 2025
e594fb9
docs: remove terms
benjamincanac Aug 7, 2025
8ce15dc
fix(Header): use `Nuxt UI` title
benjamincanac Aug 7, 2025
09fa607
fix(templates): wrong pro dir
benjamincanac Aug 7, 2025
28a5716
fix(plugins): revert `extraRuntimeDir`
benjamincanac Aug 7, 2025
7d9ba17
docs(content.config): lint
benjamincanac Aug 7, 2025
3e35bc6
docs(server): remove pro usage from `transformMDC`
benjamincanac Aug 7, 2025
a7da26f
test: update
benjamincanac Aug 7, 2025
06666e0
chore(cli): update to templates
benjamincanac Aug 7, 2025
d0ed1e0
chore(.nuxtrc): declare `@nuxt/content`
benjamincanac Aug 7, 2025
0e8bd81
fix(templates): pass `nuxt` option
benjamincanac Aug 7, 2025
f8afccb
fix(components): wrong theme path on content
benjamincanac Aug 7, 2025
a9fa310
chore(deps): update
benjamincanac Aug 7, 2025
0f16184
fix(module): prefix
benjamincanac Aug 8, 2025
26486d1
fix(prose/stubs): update path to ComponentConfig
HugoRCD Aug 8, 2025
2adce96
temporary rename `components` key in `ModuleOptions`
HugoRCD Aug 8, 2025
3d1eabf
add `@rollup/plugin-yaml` for CI
HugoRCD Aug 8, 2025
bb801e3
up
HugoRCD Aug 8, 2025
8e28034
fix(templates): remove omit
benjamincanac Aug 8, 2025
f843245
docs: update
benjamincanac Aug 8, 2025
0bc023c
up
benjamincanac Aug 8, 2025
989e04d
docs: add content config for marketing pages
HugoRCD Aug 8, 2025
477fcdb
up
benjamincanac Aug 8, 2025
a8b0c8c
up
benjamincanac Aug 8, 2025
6e1e593
up
benjamincanac Aug 8, 2025
b043a6b
up
benjamincanac Aug 11, 2025
ba4b2e0
up
benjamincanac Aug 11, 2025
e111999
feat(AIComponent): upgrade to `ai-sdk` v5
HugoRCD Aug 11, 2025
3d57a42
up
HugoRCD Aug 11, 2025
2fdabaf
up
benjamincanac Aug 11, 2025
4634fa0
Merge remote-tracking branch 'origin/v4-pro-import' into feat/ai-sdk-v5
HugoRCD Aug 11, 2025
ca0e5f5
up
HugoRCD Aug 11, 2025
f5c740d
up
HugoRCD Aug 11, 2025
1e2d732
Merge branch 'v4' into v4-pro-import
benjamincanac Aug 11, 2025
269e9f3
Merge remote-tracking branch 'origin/v4-pro-import' into feat/ai-sdk-v5
HugoRCD Aug 11, 2025
1369c2e
up
HugoRCD Aug 11, 2025
2a4be28
up
HugoRCD Aug 11, 2025
b8ce814
up
HugoRCD Aug 11, 2025
f9aa8a5
up
benjamincanac Aug 11, 2025
b70f77d
Merge remote-tracking branch 'origin/v4-pro-import' into feat/ai-sdk-v5
HugoRCD Aug 11, 2025
00b555b
chore: move `getTextFromMessage` into own util
benjamincanac Aug 11, 2025
f269135
up
benjamincanac Aug 11, 2025
e22b1d4
up
benjamincanac Aug 11, 2025
8e33267
Merge branch 'v4' into feat/ai-sdk-v5
benjamincanac Aug 11, 2025
9ddf8cc
up
benjamincanac Aug 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
NUXT_PUBLIC_SITE_URL=
# Used to fetch `nuxt/ui-pro` docs content
NUXT_GITHUB_TOKEN=
# Vercel AI gateway key
AI_GATEWAY_API_KEY=
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<script setup lang="ts">
import { useChat } from '@ai-sdk/vue'
import { Chat } from '@ai-sdk/vue'
import type { UIMessage } from 'ai'
import { getTextFromMessage } from '@nuxt/ui/utils/ai'

const messages: UIMessage[] = []
const input = ref('')

const groups = computed(() => [{
id: 'ai',
Expand All @@ -13,13 +18,13 @@ const groups = computed(() => [{
ai.value = true

if (searchTerm.value) {
setMessages([{
messages.push({
id: '1',
role: 'user',
content: searchTerm.value
}])
parts: [{ type: 'text', text: searchTerm.value }]
})

reload()
chat.regenerate()
}
}
}]
Expand All @@ -28,7 +33,15 @@ const groups = computed(() => [{
const ai = ref(false)
const searchTerm = ref('')

const { messages, input, handleSubmit, status, error, reload, setMessages } = useChat()
const chat = new Chat({
messages
})

function handleSubmit(e: Event) {
e.preventDefault()
chat.sendMessage({ text: input.value })
input.value = ''
}

function onClose(e: Event) {
e.preventDefault()
Expand All @@ -43,13 +56,13 @@ function onClose(e: Event) {
<template v-if="ai" #content>
<UChatPalette>
<UChatMessages
:messages="messages"
:status="status"
:messages="chat.messages"
:status="chat.status"
:user="{ side: 'left', variant: 'naked', avatar: { src: 'https://github.com/benjamincanac.png' } }"
:assistant="{ icon: 'i-lucide-bot' }"
>
<template #content="{ message }">
<MDC :value="message.content" :cache-key="message.id" unwrap="p" />
<MDC :value="getTextFromMessage(message)" :cache-key="message.id" unwrap="p" />
</template>
</UChatMessages>

Expand All @@ -58,7 +71,7 @@ function onClose(e: Event) {
v-model="input"
icon="i-lucide-search"
variant="naked"
:error="error"
:error="chat.error"
@submit="handleSubmit"
@close="onClose"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
<script setup lang="ts">
import { useChat } from '@ai-sdk/vue'
import { Chat } from '@ai-sdk/vue'
import type { UIMessage } from 'ai'
import { getTextFromMessage } from '@nuxt/ui/utils/ai'

const { messages, input, handleSubmit, status, error } = useChat()
const messages: UIMessage[] = []
const input = ref('')

const chat = new Chat({
messages
})

function handleSubmit(e: Event) {
e.preventDefault()
chat.sendMessage({ text: input.value })
input.value = ''
}
</script>

<template>
<UModal open :ui="{ content: 'sm:h-[28rem]' }">
<template #content>
<UChatPalette>
<UChatMessages
:messages="messages"
:status="status"
:messages="chat.messages"
:status="chat.status"
:user="{ side: 'left', variant: 'naked', avatar: { src: 'https://github.com/benjamincanac.png' } }"
:assistant="{ icon: 'i-lucide-bot' }"
>
<template #content="{ message }">
<MDC :value="message.content" :cache-key="message.id" unwrap="p" />
<MDC :value="getTextFromMessage(message)" :cache-key="message.id" unwrap="p" />
</template>
</UChatMessages>

Expand All @@ -24,7 +37,7 @@ const { messages, input, handleSubmit, status, error } = useChat()
v-model="input"
icon="i-lucide-search"
variant="naked"
:error="error"
:error="chat.error"
@submit="handleSubmit"
/>
</template>
Expand Down
54 changes: 38 additions & 16 deletions docs/content/docs/2.components/chat-message.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ The ChatMessage component renders an `<article>` element for a `user` or `assist

::u-chat-message
---
content: 'Hello! Tell me more about building AI chatbots with Nuxt UI.'
parts:
- type: 'text'
text: 'Hello! Tell me more about building AI chatbots with Nuxt UI.'
side: 'right'
variant: 'soft'
avatar:
Expand All @@ -30,18 +32,26 @@ avatar:
Use the [`ChatMessages`](/docs/components/chat-messages) component to display a list of chat messages.
::

### Content
### Parts

Use the `content` prop to display the message content.
Use the `parts` prop to display the message content using the AI SDK v5 format.

::component-code
---
prettier: true
ignore:
- parts
props:
content: 'Hello! Tell me more about building AI chatbots with Nuxt UI.'
parts:
- type: 'text'
text: 'Hello! Tell me more about building AI chatbots with Nuxt UI.'
---
::

::note
The `parts` prop is the recommended format for AI SDK v5. Each part has a `type` (e.g., 'text') and corresponding content. The ChatMessage component also supports the deprecated `content` prop for backward compatibility.
::

### Side

Use the `side` prop to display the message on the left or right.
Expand All @@ -50,10 +60,12 @@ Use the `side` prop to display the message on the left or right.
---
prettier: true
ignore:
- content
- parts
props:
side: 'right'
content: 'Hello! Tell me more about building AI chatbots with Nuxt UI.'
parts:
- type: 'text'
text: 'Hello! Tell me more about building AI chatbots with Nuxt UI.'
---
::

Expand All @@ -69,10 +81,12 @@ Use the `variant` prop to change style of the message.
---
prettier: true
ignore:
- content
- parts
props:
variant: 'soft'
content: 'Hello! Tell me more about building AI chatbots with Nuxt UI.'
parts:
- type: 'text'
text: 'Hello! Tell me more about building AI chatbots with Nuxt UI.'
---
::

Expand All @@ -88,14 +102,16 @@ Use the `icon` prop to display an [Icon](/docs/components/icon) component next t
---
prettier: true
ignore:
- content
- parts
- side
- variant
props:
icon: i-lucide-user
variant: 'soft'
side: 'right'
content: 'Hello! Tell me more about building AI chatbots with Nuxt UI.'
parts:
- type: 'text'
text: 'Hello! Tell me more about building AI chatbots with Nuxt UI.'
---
::

Expand All @@ -107,15 +123,17 @@ Use the `avatar` prop to display an [Avatar](/docs/components/avatar) component
---
prettier: true
ignore:
- content
- parts
- side
- variant
props:
avatar:
src: 'https://github.com/benjamincanac.png'
variant: 'soft'
side: 'right'
content: 'Hello! Tell me more about building AI chatbots with Nuxt UI.'
parts:
- type: 'text'
text: 'Hello! Tell me more about building AI chatbots with Nuxt UI.'
---
::

Expand All @@ -125,11 +143,13 @@ You can also use the `avatar.icon` prop to display an icon as the avatar.
---
prettier: true
ignore:
- content
- parts
props:
avatar:
icon: i-lucide-bot
content: 'Nuxt UI offers several features for building AI chatbots including the ChatMessage, ChatMessages, and ChatPrompt components. Best practices include using the useChat composable from Vercel AI SDK, implementing proper message styling with variants, and utilizing the built-in actions for message interactions. The components are fully customizable with theming support and responsive design.'
parts:
- type: 'text'
text: 'Nuxt UI offers several features for building AI chatbots including the ChatMessage, ChatMessages, and ChatPrompt components. Best practices include using the Chat class from AI SDK v5, implementing proper message styling with variants, and utilizing the built-in actions for message interactions. The components are fully customizable with theming support and responsive design.'
---
::

Expand All @@ -143,13 +163,15 @@ prettier: true
external:
- actions
ignore:
- content
- parts
- actions
props:
actions:
- label: 'Copy to clipboard'
icon: i-lucide-copy
content: 'Nuxt UI offers several features for building AI chatbots including the ChatMessage, ChatMessages, and ChatPrompt components. Best practices include using the useChat composable from Vercel AI SDK, implementing proper message styling with variants, and utilizing the built-in actions for message interactions. The components are fully customizable with theming support and responsive design.'
parts:
- type: 'text'
text: 'Nuxt UI offers several features for building AI chatbots including the ChatMessage, ChatMessages, and ChatPrompt components. Best practices include using the Chat class from AI SDK v5, implementing proper message styling with variants, and utilizing the built-in actions for message interactions. The components are fully customizable with theming support and responsive design.'
---
::

Expand Down
Loading