Nuxt UI

repository·v4·Indexed 27 days ago

https://github.com/nuxt/ui

A UI component library for Nuxt and Vue applications powered by Vue, Tailwind CSS, Reka UI, and Tailwind Variants. It provides accessible, performant, and customizable components, including a CLI for scaffolding components and locales, and a dedicated <UApp> wrapper for managing modals, toasts, and overlays.

Tokens
152K
Snippets
368
Records
1K
Agent score
90%

What's inside @nuxt/ui

  1. Overview of Nuxt UI

    v4

    Nuxt UI is a comprehensive Vue UI component library that provides over 125 accessible, production-ready components built with Tailwind CSS, Tailwind Variants, and Reka UI.

    While optimized for the Nuxt ecosystem, it is compatible with any Vue project (Vite, Inertia, SSR) by using the provided Vite plugin. It is designed with a focus on developer experience (TypeScript support, auto-completion), accessibility (WAI-ARIA compliant), and modern design.

  2. Typography and Text Formatting

    v4

    Nuxt UI provides styled typography for standard Markdown elements. Supported elements include:

    • Headings: H1 through H4.
    • Paragraphs: Standard text blocks.
    • Strong: Bold text using **text**.
    • Emphasis: Italicized text using *text*.
    • Links: External or internal links using [text](url).
    • Blockquotes: Highlighted quotes using > text.
    • Horizontal Rules: Visual separators using ---.
  3. Nuxt UI Chat Components Overview

    v4

    Nuxt UI provides a suite of components for building AI-powered chat interfaces, designed to work with the Vercel AI SDK.

    Available Components:

    • ChatMessages: Scrollable message list with auto-scroll and loading indicators.
    • ChatMessage: Individual message bubble with avatar, actions, and slots.
    • ChatPrompt: Enhanced textarea for user input.
    • ChatPromptSubmit: Submit button with automatic status handling.
    • ChatReasoning: Collapsible block for displaying AI reasoning or thinking processes.
    • ChatTool: Collapsible block for displaying AI tool invocation status.
    • ChatShimmer: Text shimmer animation for streaming states.
    • ChatPalette: Layout wrapper for embedding chat in modals or drawers.
  4. Content-specific components in Nuxt UI

    v4

    Nuxt UI provides several components specifically designed for building documentation sites with @nuxt/content:

    • ContentSearch: A built-in full-text search command palette (replaces the need for Algolia DocSearch).
    • ContentNavigation: A navigation tree component.
    • ContentToc: A sticky Table of Contents component.
    • ContentSurround: Provides 'previous' and 'next' navigation links.
  5. Explore Nuxt UI Component Categories

    v4

    Nuxt UI provides over 125+ Vue components powered by Tailwind CSS and Reka UI. Components are organized into the following functional categories:

    • Layout: Core structural components for application organization.
    • Element: Foundational UI building blocks like buttons, badges, and avatars.
    • Form: Interactive input components including text inputs, selects, checkboxes, and validation.
    • Data: Data display components such as tables, accordions, carousels, and timelines.
    • Navigation: Wayfinding components like menus, breadcrumbs, pagination, and command palettes.
    • Overlay: Floating elements including modals, popovers, tooltips, and drawers.
    • Page: Pre-built sections for marketing, blogs, and pricing pages.
    • Dashboard: Specialized components for dashboards (resizable panels, collapsible sidebars).
    • AI Chat: Conversational interface components (powered by Vercel AI SDK).
    • Editor (v4.3+): Rich text editor components (powered by TipTap).
    • Content: Integration components for Nuxt Content (Table of Contents, search).
    • Color Mode: Theme switching components (light, dark, system).
    • i18n: Internationalization and locale management components.
  6. Implement Image Upload in the Editor

    v4

    To implement image uploading, you must register a custom TipTap node via the extensions prop and define how the upload is triggered using the handlers prop.

    1. Create a Vue component using the FileUpload component.
    2. Create a custom TipTap extension to register the image node.
    3. Pass the custom extension to the Editor via the extensions prop.
  7. Configure global Toast settings via UApp

    v4

    To manage toast behavior globally, configure the toaster prop on the UApp component. This controls the default position, duration, maximum number of visible toasts, and stacking behavior.

    <script setup lang="ts">
    const toaster = {
      position: 'bottom-right', // 'horizontal' | 'vertical' (via orientation)
      duration: 5000,            // milliseconds
      max: 3,                    // max toasts displayed
      expand: true               // set to true for stacked toasts
    }
    </script>
    
    <template>
      <UApp :toaster="toaster">
        <NuxtPage />
      </UApp>
    </template>
  8. Use responsive images with zoom

    v4

    Images in Nuxt UI are responsive and support interactive zoom by default. Clicking an image opens it in a modal overlay.

    If you have @nuxt/image installed, the system will automatically use the <NuxtImg> component instead of the native img tag for better performance and optimization.

    To disable the zoom functionality for a specific image, use the :zoom="false" attribute.