This document describes the key components provided in the starter template and how to use them effectively.
The sidebar provides the main navigation for the application.
Usage:
<template>
<Sidebar />
</template>
Customization:
The header appears at the top of each page when using the default layout.
Usage:
<template>
<Header />
</template>
The main layout with sidebar and header.
Usage:
definePageMeta({
layout: "default"
});
A clean layout without navigation, useful for login/register pages.
Usage:
definePageMeta({
layout: "empty"
});
These components provide consistent UI elements throughout the application.
A reusable table component with sorting, filtering, and pagination.
Planned Usage:
<DataTable
:columns="columns"
:items="items"
:loading="loading"
@page-change="handlePageChange"
/>
Pagination controls for tables and lists.
Usage in example posts page:
<div v-if="pagination.totalPages > 1" class="mt-4 flex justify-end">
<div class="flex space-x-1">
<button
@click="changePage(pagination.currentPage - 1)"
:disabled="pagination.currentPage === 1"
class="px-3 py-1 rounded border"
:class="pagination.currentPage === 1 ? 'text-gray-400 cursor-not-allowed' : 'text-blue-600 hover:bg-blue-50'"
>
<Icon name="chevron-left" />
</button>
<!-- Page buttons -->
<button
@click="changePage(pagination.currentPage + 1)"
:disabled="pagination.currentPage === pagination.totalPages"
class="px-3 py-1 rounded border"
:class="pagination.currentPage === pagination.totalPages ? 'text-gray-400 cursor-not-allowed' : 'text-blue-600 hover:bg-blue-50'"
>
<Icon name="chevron-right" />
</button>
</div>
</div>
Common form input components with built-in validation.
Basic Pattern:
<div>
<label class="form-label">Field Name</label>
<input class="form-input" v-model="field" />
<p v-if="errors.field" class="text-red-500 text-sm mt-1"></p>
</div>
The template uses Lucide icons through the nuxt-lucide-icons module.
Usage:
<Icon name="user" />
<Icon name="lock" size="24" />
<Icon name="chevron-down" class="text-gray-500" />
Available icons can be found at Lucide Icons.
The template provides common utility classes through Tailwind CSS with custom extensions in assets/css/tailwind.css:
@layer components {
.btn {
@apply px-4 py-2 rounded font-medium focus:outline-none focus:ring-2 focus:ring-opacity-50;
}
.btn-primary {
@apply btn bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500;
}
/* Other utility classes... */
}
Usage:
<button class="btn btn-primary">Submit</button>
<button class="btn btn-secondary">Cancel</button>
<div class="card">Card content</div>