### Initialize Vue App with Router and Nuxt UI Plugin (TypeScript) Source: https://context7.com/nuxt-ui-templates/dashboard-vue/llms.txt Sets up the main Vue application instance, configures routing with Vue Router, and integrates the Nuxt UI plugin. It defines the application's routes and mounts the root component to the DOM. ```typescript import './assets/css/main.css' import { createApp } from 'vue' import { createRouter, createWebHistory } from 'vue-router' import ui from '@nuxt/ui/vue-plugin' import App from './App.vue' const app = createApp(App) app.use(createRouter({ routes: [ { path: '/', component: () => import('./pages/index.vue') }, { path: '/inbox', component: () => import('./pages/inbox.vue') }, { path: '/customers', component: () => import('./pages/customers.vue') }, { path: '/settings', component: () => import('./pages/settings.vue'), children: [ { path: '', component: () => import('./pages/settings/index.vue') }, { path: 'members', component: () => import('./pages/settings/members.vue') }, { path: 'notifications', component: () => import('./pages/settings/notifications.vue') }, { path: 'security', component: () => import('./pages/settings/security.vue') }, ] } ], history: createWebHistory() })) app.use(ui) app.mount('#app') ``` -------------------------------- ### Configure Vite with Nuxt UI Theme Customization (TypeScript) Source: https://context7.com/nuxt-ui-templates/dashboard-vue/llms.txt Configures the Vite build process to include the Nuxt UI plugin and allows for theme customization. This snippet demonstrates how to set primary and neutral colors for the Nuxt UI theme. ```typescript import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import ui from '@nuxt/ui/vite' export default defineConfig({ plugins: [ vue(), ui({ ui: { colors: { primary: 'green', neutral: 'zinc' } } }) ] }) ``` -------------------------------- ### Vue App Layout with Sidebar and Search Source: https://context7.com/nuxt-ui-templates/dashboard-vue/llms.txt Root Vue application component (`App.vue`) that sets up the main dashboard layout. It includes a collapsible and resizable sidebar with navigation links, a search component, and handles cookie consent notifications. Dependencies include Vue, Vue Router, Nuxt UI, and VueUse. ```vue ``` -------------------------------- ### Vue Composable for Dashboard with Keyboard Shortcuts Source: https://context7.com/nuxt-ui-templates/dashboard-vue/llms.txt A shared composable function (`useDashboard.ts`) for managing dashboard-specific state and interactions. It integrates keyboard shortcuts for navigation and controls the visibility of a notifications slideover. Dependencies include Vue, Vue Router, and VueUse's `createSharedComposable`. ```typescript // src/composables/useDashboard.ts import { ref, watch } from 'vue' import { useRoute, useRouter } from 'vue-router' import { createSharedComposable } from '@vueuse/core' const _useDashboard = () => { const route = useRoute() const router = useRouter() const isNotificationsSlideoverOpen = ref(false) // Define keyboard shortcuts for navigation defineShortcuts({ 'g-h': () => router.push('/'), 'g-i': () => router.push('/inbox'), 'g-c': () => router.push('/customers'), 'g-s': () => router.push('/settings'), 'n': () => isNotificationsSlideoverOpen.value = !isNotificationsSlideoverOpen.value }) // Auto-close slideover on route change watch(() => route.fullPath, () => { isNotificationsSlideoverOpen.value = false }) return { isNotificationsSlideoverOpen } } export const useDashboard = createSharedComposable(_useDashboard) ``` -------------------------------- ### Vue Template for UTable with Filtering and Pagination Source: https://context7.com/nuxt-ui-templates/dashboard-vue/llms.txt This Vue.js template snippet demonstrates the usage of the UTable component, including functionalities for column filtering, row selection, and pagination. It utilizes UInput and USelect for filter controls and UPagination for page navigation. The styling is customized using Tailwind CSS classes. ```vue ``` -------------------------------- ### Vue Page for Inbox with Responsive Panels Source: https://context7.com/nuxt-ui-templates/dashboard-vue/llms.txt This Vue.js page component sets up an inbox layout with resizable panels. It uses VueUse composables for data fetching and breakpoint detection. The layout adapts to mobile devices using a slideover for mail details. It integrates with custom components like InboxList and InboxMail. ```vue ``` -------------------------------- ### Vue.js Interactive Revenue Chart with UnoVis Source: https://context7.com/nuxt-ui-templates/dashboard-vue/llms.txt This Vue.js component generates an interactive line and area chart to display revenue data. It utilizes UnoVis for charting, date-fns for date manipulation, and VueUse for element sizing. The chart features tooltips, crosshairs, and customizable axis formatting based on the selected period (daily, weekly, monthly) and date range. It depends on @unovis/vue, date-fns, and @vueuse/core. ```vue ``` -------------------------------- ### Vue Home Dashboard Page with Nuxt UI Source: https://context7.com/nuxt-ui-templates/dashboard-vue/llms.txt The main dashboard page component written in Vue.js with TypeScript, utilizing Nuxt UI components for layout and interactivity. It includes state management for date ranges and periods, along with dropdown menus and tooltips. ```vue ``` -------------------------------- ### Vue User Menu with Theme Customization Source: https://context7.com/nuxt-ui-templates/dashboard-vue/llms.txt This Vue component creates a user dropdown menu. It utilizes Nuxt UI for the dropdown and button components, and VueUse for color mode management. The menu includes options for profile navigation, theme color selection (primary and neutral), appearance (light/dark mode), and links to documentation and GitHub. It also features nested menus for theme customization. ```vue ``` -------------------------------- ### TypeScript Type Definitions (TypeScript) Source: https://context7.com/nuxt-ui-templates/dashboard-vue/llms.txt Core data models for the dashboard application written in TypeScript. Defines types for user status, sale status, user details, mail, members, statistics, sales, and date ranges. Uses `@nuxt/ui` AvatarProps for avatar definitions. ```typescript // src/types/index.d.ts import type { AvatarProps } from '@nuxt/ui' export type UserStatus = 'subscribed' | 'unsubscribed' | 'bounced' export type SaleStatus = 'paid' | 'failed' | 'refunded' export interface User { id: number name: string email: string avatar?: AvatarProps status: UserStatus location: string } export interface Mail { id: number unread?: boolean from: User subject: string body: string date: string } export interface Member { name: string username: string role: 'member' | 'owner' avatar: AvatarProps } export interface Stat { title: string icon: string value: number | string variation: number formatter?: (value: number) => string } export interface Sale { id: string date: string status: SaleStatus email: string amount: number } export interface Notification { id: number unread?: boolean sender: User body: string date: string } export type Period = 'daily' | 'weekly' | 'monthly' export interface Range { start: Date end: Date } ``` -------------------------------- ### Notifications Slideover Component (Vue) Source: https://context7.com/nuxt-ui-templates/dashboard-vue/llms.txt A Vue component that displays real-time notifications in a slideover panel. It uses `@vueuse/core` for fetching data and formatting time, and `useDashboard` composable for managing slideover state. Displays sender information, notification body, and unread status. ```vue ``` -------------------------------- ### Vue.js Customer Data Table with Sorting and Filtering Source: https://context7.com/nuxt-ui-templates/dashboard-vue/llms.txt This Vue.js component implements an advanced data table for customer management. It includes features like row selection, custom cell rendering for avatars and badges, dynamic sorting, filtering, and a context menu for actions. It utilizes Nuxt UI components and @tanstack/table-core for table functionality. ```vue