npm @nuxt/ui 4.13.0
v4.13.0

55 minutes ago

✨ Highlights

🌟 Toggle and ToggleGroup components

New Toggle and ToggleGroup components let you build buttons that can be pressed on or off, alone or as a group where type="multiple" allows several at once:

<script setup lang="ts">
const bold = ref(false)
const align = ref('left')
</script>

<template>
  <UToggle v-model="bold" icon="i-lucide-bold" aria-label="Bold" />

  <UToggleGroup
    v-model="align"
    :items="[
      { value: 'left', icon: 'i-lucide-align-left', 'aria-label': 'Left' },
      { value: 'center', icon: 'i-lucide-align-center', 'aria-label': 'Center' },
      { value: 'right', icon: 'i-lucide-align-right', 'aria-label': 'Right' }
    ]"
  />
</template>

Tip

They take the Button props, plus active-color and active-variant for the pressed state.

📎 Files in ChatPrompt

The ChatPrompt component now accepts files with v-model:files, pasted or dropped on the prompt and listed with the new ChatAttachment component:

<template>
  <UChatPrompt v-model="input" v-model:files="files" @submit="onSubmit">
    <UChatPromptSubmit :status="status" />
  </UChatPrompt>
</template>

Tip

Use toFileUIParts from @nuxt/ui/utils/ai to send them with the AI SDK, and v-model:queue to queue the messages sent while a response is streaming.

🔔 Promise toasts

A new promise method on useToast shows a loading toast and updates it when the promise settles:

const toast = useToast()

await toast.promise($fetch('/api/save', { method: 'POST' }), {
  loading: 'Saving...',
  success: { title: 'Saved', color: 'success' },
  error: (error: any) => ({ title: error.message, color: 'error' })
})

🎨 ESLint config

Nuxt UI now ships an ESLint config that checks your Tailwind CSS classes against your theme, like text-gray-500 where a semantic token such as text-muted exists:

export default defineNuxtConfig({
  modules: ['@nuxt/eslint', '@nuxt/ui'],
  css: ['~/assets/css/main.css'],
  ui: {
    eslint: true
  }
})

Note

It needs eslint-plugin-better-tailwindcss installed. Check the Vue guide to use it without Nuxt.

👉 Changelog

compare changes

🚀 Features

  • Select/SelectMenu/InputMenu: add item to trigger slots (#7437)
  • locale: add Serbian (Cyrillic and Latin) (#7424)
  • useToast: add promise method (#7383)
  • Toggle/ToggleGroup: new components (#7364)
  • Switch: stretch thumb on press (#7343)
  • module: add @nuxt/ui/eslint config (#7329)
  • ChatPrompt: add v-model:queue (#7301)
  • ChatAttachment: new component (#7299)
  • ChatMessages: add footer slot (#7268)
  • ChatTool: add error prop (#7253)
  • ChatMessage: add part slot (#7251)
  • ChatMessages: expose scroll methods and mark the list as a live region (#7249)
  • CommandPalette: add ignoreFilter prop (#7224)

🐛 Bug Fixes

  • utils: only match null with null in compare (#7441)
  • Table: accept readonly arrays in data prop (#7412)
  • locale: name the slide in carousel labels (#7422)
  • locale: let each locale order the prose collapse labels (#7421)
  • locale: correct mistranslations across locales (#7423)
  • CommandPalette: hide focus outline on content (#7420)
  • locale: improve Uzbek translation accuracy and consistency (#7416)
  • components: ignore objects wrapped in __v_raw (#7419)
  • components: ignore components compiled from a template string (#7417)
  • Calendar: keep focus inside when switching views (#7407)
  • Calendar: keep an uncontrolled selection when switching views (#7401)
  • ContentToc: hold the highlight indicator still on its far edge (#7409)
  • SelectMenu: reset the search term when selecting the current item (#7403)
  • Listbox: emit change on uncontrolled deselect (#7402)
  • InputMenu: keep the selected label out of the search term (#7404)
  • ProseCallout: keep icon inline with first paragraph (#7381)
  • ContentSearch: stop escaping result text twice (#7374)
  • Stepper: announce current step from 1 (#7342)
  • Table: add aria-busy while loading (#7368)
  • Table: hide the empty state while loading (#7360)
  • Table: add scope to footer header cells (#7357)
  • ProseTh: add scope="col" to header cells (#7356)
  • ContentSearchButton: use valid HTML structure for trailing slot (#7355)
  • ContextMenu/DropdownMenu: pass active to the menu item slot (#7349)
  • module: lazy load @nuxtjs/i18n locales (#7330)
  • module: import useImage instead of re-exporting it from #imports (#7319)
  • Checkbox/Switch: open overlays on label hover (#7225)
  • ProseImg/ColorModeImage: avoid applying app.baseURL twice with @nuxt/image (#7278)
  • Table: merge grouped headers across rows (#7240)
  • module: skip prose components when prose is false (#7266)
  • ChatTool: pick up a default slot added after mount (#7297)
  • ChatMessages: measure the submitted message once the layout settles (#7295)
  • prose: size inline code in headings without anchor links (#7291)
  • Toaster: expand stacked toasts on keyboard focus (#7279)
  • ChatPrompt: prevent rounded corners from clipping the caret (ef6b6934b)
  • Checkbox/RadioGroup: allow block content in label slot (#7141)
  • Select/SelectMenu: keep rounded corners in FieldGroup inside a form (#7261)
  • components: add missing as title support (#7260)
  • ChatPrompt: ignore submits while the chat is streaming (#7248)
  • ChatMessages: stop reasoning and tool parts when the chat is stopped (#7247)
  • ChatMessages: keep the user's scroll position while streaming (#7244)
  • ChatReasoning: don't auto-close after the user toggles it (#7246)
  • defineShortcuts: match key sequences case insensitively (#7229)
  • LocaleSelect: show Tajikistan flag for the Tajik locale (#7237)
  • ChatMessage: show actions on focus and align them in RTL (#7245)
  • ai: stop isToolStreaming on denied approvals (#7243)
  • module: bundle the icons set in app config (#7238)
  • Chart: animate data changes (#7234)
  • Table: avoid re-rendering virtualized rows on every scroll (#7231)
  • Sidebar: add missing button type to rail (#7214)
  • SelectMenu: allow keyboard navigation with search input autofocus disabled (#7212)

🔥 Performances

  • PageCard: share one pointer tracker between spotlight cards (#7418)
  • Link: forward props without reactiveOmit (#7384)
  • components: forward picked props without reactivePick (#7367)
  • module: load tailwindcss/colors lazily when hydrating (#7311)
  • PageCard: only track the mouse with spotlight, once idle (#7310)
  • components: share tv invocation results across equal variant props (#7309)
  • module: stop recompiling templates on every file change (#7304)
  • useComponentProps: cache prop name case conversions (#7286)
  • useComponentProps: cache prop name case conversions (#7286)
  • components: memoize tv components per theme and config (#7285)
  • Button: read the link props in one pass (#7239)
  • Button: skip the link when there is no to or href (#7221)

📖 Documentation

  • showcase: add capacities (3879d262e)
  • showcase: add citrusmail and faivelo (#7390)
  • calendar: read example dates in UTC (#7405)
  • tabs: show a non-default size in the size example (#7393)
  • theme: keep shared link overrides to theme values (28a332e9f)
  • typography: render markdown in callout examples (65bba7241)
  • theme: preview theme options on hover (#7379)
  • app: type tagPriority as a literal in theme styles (#7365)
  • app: replace numeric tagPriority and add og:image dimensions on theme page (cb0a51f12)
  • templates: list the guides in llms.txt and link the editor guide (366e94845)
  • showcase: add virtualrh.fr (#7321)
  • templates: add the editor guide (#7308)
  • update outdated models and examples (#7317)
  • templates: add the dashboard guide (#7312)
  • templates: drop the closing line of the chat guide (#7314)
  • templates: move the AI chat guide to /templates/chat (#7303)
  • playground: use components in hand-built tiles (#7306)
  • getting-started: add image integration page (#7300)
  • components: link TanStack Virtual and Charts docs of the major we use (#7298)
  • chat: queue messages sent while a response streams (#7264)
  • allow crawlers on build assets (84a48cb17)
  • chat-messages: add an agent steps example (#7256)
  • use-tour: add spotlight example (#7184)
  • blog: pass status to UChatPrompt in the AI chat guide (#7262)
  • disable server sourcemaps in dev (3456d03f7)
  • server: validate paths in github commits endpoint (#7216)
  • content: update badges (6902550d6)

🏡 Chore

  • github: use uppt sections for the release headings (#7442)
  • github: start release changelogs at the branch's own tags (#7436)
  • github: release with uppt and npm trusted publishing (#7434)
  • github: replace tia with issue workflows (5122d2d15)
  • github: remove unused env variable (#7387)
  • skills: add getRowId and watch-options to the table recipe (#7320)
  • pre-bundle docs and playground deps (8471aa71c)

✅ Tests

  • Toast: keep the close timer from firing after teardown (#7315)
  • bench: repeat the re-render cycles 20 times like on v5 (#7213)

🎉 New Contributors

💚 Contributors

Don't miss a new ui release

NewReleases is sending notifications on new releases.