Skip to content

secondsky/claude-skills / plugins/nuxt-ui-v4/skills/nuxt-ui-v4

nuxt-ui-v4

Verified

Nuxt UI v4 component library for building Nuxt v4 applications. 125+ accessible components with Tailwind v4, Reka UI, dark mode, theming. Use for dashboards, forms, overlays, editors, page layouts, pricing pages, or encountering component, theming, or TypeScript errors.

FileKindSize
SKILL.mdskill md13.0 KB
references/COMMON_ERRORS_DETAILED.mdmarkdown24.7 KB
references/accessibility-patterns.mdmarkdown822 B
references/ai-sdk-v5-integration.mdmarkdown6.4 KB
references/auth-form.mdmarkdown6.4 KB
references/chat-components.mdmarkdown13.2 KB
references/chat-reasoning.mdmarkdown3.0 KB
references/chat-shimmer.mdmarkdown1.6 KB
references/chat-tool.mdmarkdown3.6 KB
references/command-palette-setup.mdmarkdown1.1 KB
references/common-components.mdmarkdown1.2 KB
references/component-theming-guide.mdmarkdown13.2 KB
references/composables-guide.mdmarkdown908 B
references/content-components.mdmarkdown7.3 KB
references/css-variables-reference.mdmarkdown14.9 KB
references/dark-mode-guide.mdmarkdown10.9 KB
references/dashboard-components.mdmarkdown8.1 KB
references/data-display-components.mdmarkdown11.7 KB
references/design-system-guide.mdmarkdown16.1 KB
references/editor-components.mdmarkdown7.9 KB
references/feedback-components-reference.mdmarkdown11.4 KB
references/form-advanced-patterns.mdmarkdown1.7 KB
references/form-components-reference.mdmarkdown14.0 KB
references/form-validation-patterns.mdmarkdown6.4 KB
references/i18n-integration.mdmarkdown12.8 KB
references/icon-system-guide.mdmarkdown14.5 KB
references/layout-components-reference.mdmarkdown9.5 KB
references/loading-feedback-patterns.mdmarkdown1.0 KB
references/navigation-components-reference.mdmarkdown8.8 KB
references/nuxt-content-integration.mdmarkdown15.7 KB
references/nuxt-v4-features.mdmarkdown8.0 KB
references/overlay-decision-guide.mdmarkdown1.3 KB
references/page-layout-components.mdmarkdown8.4 KB
references/performance-optimization.mdmarkdown12.8 KB
references/pricing-components.mdmarkdown7.7 KB
references/responsive-patterns.mdmarkdown795 B
references/semantic-color-system.mdmarkdown1.3 KB
references/tailwind-prefix-guide.mdmarkdown7.6 KB
references/typescript-setup.mdmarkdown10.8 KB
scripts/check-versions.shexecutablescript1.3 KB
templates/app.config.tsscript2.5 KB
templates/app.vueother1.1 KB
templates/components/ui-avatar-badge.vueother7.7 KB
templates/components/ui-card-layouts.vueother5.9 KB
templates/components/ui-carousel-gallery.vueother1.4 KB
templates/components/ui-chat-full.vueother3.4 KB
templates/components/ui-chat-interface.vueother8.8 KB
templates/components/ui-command-palette.vueother1.8 KB
templates/components/ui-content-prose.vueother7.2 KB
templates/components/ui-dark-mode-toggle.vueother7.4 KB
templates/components/ui-data-table.vueother7.1 KB
templates/components/ui-drawer-mobile.vueother5.2 KB
templates/components/ui-dropdown-menu.vueother6.3 KB
templates/components/ui-empty-state.vueother5.2 KB
templates/components/ui-feedback-states.vueother6.2 KB
templates/components/ui-form-example.vueother4.5 KB
templates/components/ui-input-date.vueother5.2 KB
templates/components/ui-input-time.vueother5.8 KB
templates/components/ui-modal-dialog.vueother8.0 KB
templates/components/ui-navigation-tabs.vueother7.2 KB
templates/components/ui-popover-tooltip.vueother2.6 KB
templates/components/ui-toast-notifications.vueother8.9 KB
templates/composables/useAIChat.tsscript2.9 KB
templates/composables/useI18nForm.tsscript9.6 KB
templates/composables/useNuxtUITheme.tsscript2.4 KB
templates/layouts/dashboard.vueother3.7 KB
templates/nuxt.config.tsscript1.3 KB
templates/pages/landing.vueother5.9 KB

templates/components/ui-toast-notifications.vue

View on GitHub
<template>
  <div class="p-6">
    <UCard>
      <template #header>
        <h2 class="text-2xl font-bold">Toast Notifications Example</h2>
        <p class="text-dimmed mt-1">Demonstrates useToast composable with various styles and actions</p>
      </template>

      <div class="space-y-6">
        <!-- Basic Toasts -->
        <div>
          <h3 class="text-lg font-semibold mb-3">Basic Notifications</h3>
          <div class="flex flex-wrap gap-2">
            <UButton @click="showSuccess">Success</UButton>
            <UButton @click="showError" color="error">Error</UButton>
            <UButton @click="showWarning" color="warning">Warning</UButton>
            <UButton @click="showInfo" color="info">Info</UButton>
          </div>
        </div>

        <!-- Toast with Description -->
        <div>
          <h3 class="text-lg font-semibold mb-3">With Description</h3>
          <UButton @click="showWithDescription">Show Description</UButton>
        </div>

        <!-- Toast with Actions -->
        <div>
          <h3 class="text-lg font-semibold mb-3">With Actions</h3>
          <div class="flex gap-2">
            <UButton @click="showWithAction">Undo Action</UButton>
            <UButton @click="showWithMultipleActions" variant="outline">Multiple Actions</UButton>
          </div>
        </div>

        <!-- Toast Positions -->
        <div>
          <h3 class="text-lg font-semibold mb-3">Position Variants</h3>
          <div class="grid grid-cols-2 md:grid-cols-3 gap-2">
            <UButton @click="showPosition('top-left')" variant="outline" size="sm">Top Left</UButton>
            <UButton @click="showPosition('top-center')" variant="outline" size="sm">Top Center</UButton>
            <UButton @click="showPosition('top-right')" variant="outline" size="sm">Top Right</UButton>
            <UButton @click="showPosition('bottom-left')" variant="outline" size="sm">Bottom Left</UButton>
            <UButton @click="showPosition('bottom-center')" variant="outline" size="sm">Bottom Center</UButton>
            <UButton @click="showPosition('bottom-right')" variant="outline" size="sm">Bottom Right</UButton>
          </div>
        </div>

        <!-- Custom Timeout -->
        <div>
          <h3 class="text-lg font-semibold mb-3">Custom Timeout</h3>
          <div class="flex gap-2">
            <UButton @click="showWithTimeout(2000)" size="sm">2 seconds</UButton>
            <UButton @click="showWithTimeout(5000)" size="sm">5 seconds</UButton>
            <UButton @click="showWithTimeout(10000)" size="sm">10 seconds</UButton>
            <UButton @click="showPersistent" size="sm" variant="outline">No Auto-close</UButton>
          </div>
        </div>

        <!-- Loading Toast -->
        <div>
          <h3 class="text-lg font-semibold mb-3">Loading States</h3>
          <UButton @click="showLoadingToast">Simulate Loading</UButton>
        </div>

        <!-- Clear All Toasts -->
        <div>
          <h3 class="text-lg font-semibold mb-3">Clear Toasts</h3>
          <UButton @click="clearAllToasts" color="error" variant="ghost">Clear All</UButton>
        </div>

        <!-- Toast Composable Info -->
        <UAlert
          color="info"
          variant="subtle"
          title="useToast Composable"
          description="Toasts are managed globally through the useToast() composable. They persist across route changes and automatically stack when multiple are shown."
          icon="i-heroicons-information-circle"
        />
      </div>
    </UCard>
  </div>
</template>

<script setup lang="ts">
// Get toast composable
const { add: addToast, remove: removeToast, clear: clearToasts } = useToast()

// Basic success toast
function showSuccess() {
  addToast({
    title: 'Success!',
    description: 'Your action completed successfully',
    color: 'success',
    icon: 'i-heroicons-check-circle',
    timeout: 3000
  })
}

// Error toast
function showError() {
  addToast({
    title: 'Error',
    description: 'Something went wrong. Please try again.',
    color: 'error',
    icon: 'i-heroicons-x-circle',
    timeout: 5000
  })
}

// Warning toast
function showWarning() {
  addToast({
    title: 'Warning',
    description: 'Please review your changes before proceeding',
    color: 'warning',
    icon: 'i-heroicons-exclamation-triangle',
    timeout: 4000
  })
}

// Info toast
function showInfo() {
  addToast({
    title: 'Information',
    description: 'New features are now available in settings',
    color: 'info',
    icon: 'i-heroicons-information-circle',
    timeout: 3000
  })
}

// Toast with longer description
function showWithDescription() {
  addToast({
    title: 'Update Available',
    description: 'A new version of this application is available. Click the button below to refresh and get the latest features and bug fixes.',
    color: 'info',
    icon: 'i-heroicons-arrow-path',
    timeout: 6000
  })
}

// Toast with action button
function showWithAction() {
  addToast({
    title: 'Item Deleted',
    description: 'The item has been removed from your list',
    color: 'success',
    icon: 'i-heroicons-trash',
    timeout: 5000,
    actions: [{
      label: 'Undo',
      click: () => {
        console.log('Undo clicked')
        addToast({
          title: 'Restored',
          description: 'Item has been restored',
          color: 'success',
          timeout: 2000
        })
      }
    }]
  })
}

// Toast with multiple actions
function showWithMultipleActions() {
  addToast({
    title: 'New Message',
    description: 'You have received a new message from John Doe',
    color: 'info',
    icon: 'i-heroicons-envelope',
    timeout: 0,  // No auto-close
    actions: [
      {
        label: 'View',
        click: () => {
          console.log('View clicked')
        }
      },
      {
        label: 'Dismiss',
        click: (toast) => {
          if (toast?.id) {
            removeToast(toast.id)
          }
        }
      }
    ]
  })
}

// Toast at different positions
function showPosition(position: string) {
  addToast({
    title: `Toast Position: ${position}`,
    description: 'This toast appears at a custom position',
    color: 'primary',
    icon: 'i-heroicons-map-pin',
    timeout: 3000,
    // Note: Position is configured globally in app.config.ts
    // This is just for demonstration
  })
}

// Toast with custom timeout
function showWithTimeout(ms: number) {
  addToast({
    title: `${ms / 1000} Second Toast`,
    description: `This toast will auto-close in ${ms / 1000} seconds`,
    color: 'neutral',
    icon: 'i-heroicons-clock',
    timeout: ms
  })
}

// Persistent toast (no auto-close)
function showPersistent() {
  addToast({
    title: 'Persistent Notification',
    description: 'This toast will not auto-close. Click the X to dismiss.',
    color: 'warning',
    icon: 'i-heroicons-bell',
    timeout: 0,  // 0 = no auto-close
    actions: [{
      label: 'Got it',
      click: (toast) => {
        if (toast?.id) {
          removeToast(toast.id)
        }
      }
    }]
  })
}

// Loading toast with async operation
async function showLoadingToast() {
  const loadingToast = addToast({
    title: 'Processing...',
    description: 'Please wait while we complete your request',
    color: 'info',
    icon: 'i-heroicons-arrow-path',
    timeout: 0  // Don't auto-close while loading
  })

  // Simulate async operation
  await new Promise(resolve => setTimeout(resolve, 3000))

  // Remove loading toast
  if (loadingToast?.id) {
    removeToast(loadingToast.id)
  }

  // Show success toast
  addToast({
    title: 'Complete!',
    description: 'Your request has been processed successfully',
    color: 'success',
    icon: 'i-heroicons-check-circle',
    timeout: 3000
  })
}

// Clear all toasts
function clearAllToasts() {
  clearToasts()

  // Show confirmation
  setTimeout(() => {
    addToast({
      title: 'Cleared',
      description: 'All notifications have been cleared',
      color: 'neutral',
      timeout: 2000
    })
  }, 100)
}

// Example: Real-world usage patterns
/*
// 1. Form submission success
async function submitForm() {
  try {
    await api.submitForm(data)
    addToast({
      title: 'Form Submitted',
      description: 'Your form has been submitted successfully',
      color: 'success'
    })
  } catch (error) {
    addToast({
      title: 'Submission Failed',
      description: error.message,
      color: 'error'
    })
  }
}

// 2. File upload progress
async function uploadFile(file) {
  const toast = addToast({
    title: 'Uploading...',
    description: 'Please wait',
    timeout: 0
  })

  try {
    await uploadAPI(file)
    removeToast(toast.id)
    addToast({
      title: 'Upload Complete',
      color: 'success'
    })
  } catch (error) {
    removeToast(toast.id)
    addToast({
      title: 'Upload Failed',
      description: error.message,
      color: 'error'
    })
  }
}

// 3. Clipboard copy
async function copyToClipboard(text) {
  await navigator.clipboard.writeText(text)
  addToast({
    title: 'Copied!',
    timeout: 2000
  })
}
*/
</script>
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall