Skip to content

Commit f2a2631

Browse files
committed
theme, packages, and improvements
1 parent c3c412a commit f2a2631

28 files changed

+468
-313
lines changed

README.md

+40-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Vue SPA w/ PrimeVue & Laravel Breeze API Starter Kit
22

3-
![Static Badge](<https://img.shields.io/badge/Vue.js%20-%20v3.5%20-%20rgb(66%20184%20131)>) ![Static Badge](https://img.shields.io/badge/PrimeVue%20-%20v4%20-%20rgb(16%20185%20129)) ![Static Badge](https://img.shields.io/badge/Tailwind%20CSS%20-%20v4%20-%20%230284c7)
3+
![Static Badge](<https://img.shields.io/badge/Vue.js%20-%20v3.5%20-%20rgb(66%20184%20131)>) ![Static Badge](<https://img.shields.io/badge/PrimeVue%20-%20v4%20-%20rgb(16%20185%20129)>) ![Static Badge](https://img.shields.io/badge/Tailwind%20CSS%20-%20v4%20-%20%230284c7)
44

55
A [PrimeVue](https://primevue.org/) SPA starter kit meant for use with a [Laravel Breeze](https://laravel.com/docs/master/starter-kits#laravel-breeze) API stack backend.
66

77
An alternative to using the [Laravel, Inertia.js, & PrimeVue Starter Kit](https://github.com/connorabbas/laravel-inertia-primevue).
88

9-
## Setup
9+
## Setup
10+
1011
1. Clone the repo (or download the zip)
1112
2. Create a new `.env` file in the root directory, reference the `.env.example` file for the vars/values
12-
3. Create a [new Laravel application](https://laravel.com/docs/master/installation)
13+
3. Create a [new Laravel application](https://laravel.com/docs/master/installation)
1314
4. Install [Laravel Breeze](https://laravel.com/docs/master/starter-kits#laravel-breeze-installation) using the [API Stack](https://laravel.com/docs/master/starter-kits#breeze-and-next) option
1415
5. Setup necessary `.env` configuration values in the Laravel API project
1516
```
@@ -21,9 +22,11 @@ An alternative to using the [Laravel, Inertia.js, & PrimeVue Starter Kit](https:
2122
SESSION_DOMAIN="vue-spa.localhost"
2223
```
2324
6. Setup additional routes and controllers for profile page in the Laravel API project:
25+
2426
```
2527
php artisan make:controller ProfileController
2628
```
29+
2730
```php
2831
<?php
2932
@@ -89,9 +92,11 @@ An alternative to using the [Laravel, Inertia.js, & PrimeVue Starter Kit](https:
8992
}
9093
9194
```
95+
9296
```
9397
php artisan make:controller Auth/PasswordController
9498
```
99+
95100
```php
96101
<?php
97102
@@ -131,6 +136,7 @@ An alternative to using the [Laravel, Inertia.js, & PrimeVue Starter Kit](https:
131136
}
132137
133138
```
139+
134140
```php
135141
Route::controller(App\Http\Controllers\ProfileController::class)
136142
->middleware('auth')
@@ -145,11 +151,39 @@ An alternative to using the [Laravel, Inertia.js, & PrimeVue Starter Kit](https:
145151
```
146152
147153
## TypeScript
154+
148155
TypeScript is configured and ready for use if desired, but is not required.
149156
150157
## Theme
151-
This starter kit provides a light/dark mode and custom theme functionality provided by the powerful PrimeVue theming system, using styled mode and custom design token values.
152158
153-
The starting point for customizing your theme will be the `theme-preset.js` file at the root of the project. To quickly change the look and feel of your theme, swap the [primary](https://primevue.org/theming/styled/#primary) values with a different set of [colors](https://primevue.org/theming/styled/#colors), change the [surface](https://primevue.org/theming/styled/#surface) `colorScheme` values (slate, gray, neutral, etc.), or completely change the [preset theme](https://primevue.org/theming/styled/#presets) (Aura used by default).
159+
This starter kit features a built-in light/dark mode toggle along with a collection of custom theme presets built using the powerful **PrimeVue V4** theming system. It leverages styled mode and custom design token values to create flexible and cohesive UI designs.
160+
161+
### Prebuilt Theme Presets
162+
163+
The prebuilt theme presets are located in the `/resources/js/theme` directory. Each preset offers a distinct visual style:
164+
165+
- **noir**
166+
A minimal, monochromatic theme that serves as the default style.
167+
168+
- **bootstrap**
169+
Emulates the familiar look and feel of [Bootstrap](https://getbootstrap.com/).
170+
171+
- **breeze**
172+
Captures the aesthetic of [Laravel Breeze](https://laravel.com/docs/master/starter-kits#laravel-breeze).
173+
174+
- **enterprise**
175+
Provides a clean, no-nonsense corporate design.
176+
177+
### Customizing Your Own Theme
178+
179+
Creating your own theme preset is simple. You can:
180+
181+
- Swap the [primary](https://primevue.org/theming/styled/#primary) values with a different set of [colors](https://primevue.org/theming/styled/#colors).
182+
- Adjust the `colorScheme` [surface](https://primevue.org/theming/styled/#surface) values (e.g., slate, gray, neutral).
183+
- Change the extended [preset theme](https://primevue.org/theming/styled/#presets).
184+
185+
For detailed guidance on customization, please refer to the [PrimeVue Styled Mode Docs](https://primevue.org/theming/styled/).
186+
187+
## PrimeVue v4 w/ Tailwind CSS
154188
155-
Please reference the [PrimeVue Styled Mode Docs](https://primevue.org/theming/styled/) to fully understand how this system works, and how to further customize your theme to make it your own.
189+
To clarify, Tailwind is **not** used for any component styling in this starter kit; instead, we use PrimeVue's styled mode with a custom theme preset implementation for component styling. Tailwind is applied solely for layout purposes **around** PrimeVue components and for minimal styling when needed.

package-lock.json

+52-44
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
},
1212
"devDependencies": {
1313
"@eslint/js": "^9.18.0",
14+
"@primeuix/themes": "^1.0.0",
1415
"@primevue/auto-import-resolver": "^4.2.5",
15-
"@primevue/themes": "^4.2.5",
1616
"@tailwindcss/vite": "^4.0.0",
1717
"@typescript-eslint/eslint-plugin": "^8.19.1",
1818
"@typescript-eslint/parser": "^8.19.1",
@@ -25,14 +25,14 @@
2525
"nprogress": "^0.2.0",
2626
"pinia": "^2.1.7",
2727
"primeicons": "^7.0.0",
28-
"primevue": "^4.2.5",
28+
"primevue": "^4.3.0",
2929
"tailwindcss": "^4.0.0",
30-
"tailwindcss-primeui": "^0.3.4",
30+
"tailwindcss-primeui": "^0.5.0",
3131
"typescript": "^5.7.3",
3232
"typescript-eslint": "^8.19.1",
3333
"unplugin-vue-components": "^0.27.4",
3434
"vite": "^6.0",
3535
"vue": "^3.5.0",
3636
"vue-router": "^4.4.0"
3737
}
38-
}
38+
}

src/app.js

+16-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'nprogress/nprogress.css';
44
import 'primeicons/primeicons.css';
55

66
import { useDark } from '@vueuse/core';
7-
import customThemePreset from '../theme-preset.js';
7+
import customThemePreset from './theme/noir-preset';
88

99
import { createApp } from 'vue';
1010
import { createPinia } from 'pinia';
@@ -15,6 +15,9 @@ import App from './App.vue';
1515
import PrimeVue from 'primevue/config';
1616
import ToastService from 'primevue/toastservice';
1717

18+
import Container from '@/components/Container.vue';
19+
import PageTitleSection from '@/components/PageTitleSection.vue';
20+
1821
const app = createApp(App);
1922
const pinia = createPinia();
2023
const darkMode = useDark(); // set Light/Dark Mode
@@ -23,7 +26,18 @@ app.provide('darkMode', darkMode)
2326
.use(pinia)
2427
.use(router)
2528
.use(PrimeVue, {
26-
theme: customThemePreset,
29+
theme: {
30+
preset: customThemePreset,
31+
options: {
32+
darkModeSelector: '.dark',
33+
cssLayer: {
34+
name: 'primevue',
35+
order: 'tailwind-theme, tailwind-base, primevue, tailwind-utilities',
36+
},
37+
},
38+
},
2739
})
2840
.use(ToastService)
41+
.component('Container', Container)
42+
.component('PageTitleSection', PageTitleSection)
2943
.mount('#app');

src/assets/css/tailwind.css

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
@layer tailwind-theme, tailwind-base, primevue, tailwind-utilities;
2-
31
@import 'tailwindcss/theme.css' layer(tailwind-theme);
42
@import './custom-preflight.css' layer(tailwind-base);
5-
/* @import "tailwindcss/preflight.css" layer(tailwind-base); */
63
@import 'tailwindcss/utilities.css' layer(tailwind-utilities);
7-
8-
@plugin 'tailwindcss-primeui';
4+
@import 'tailwindcss-primeui';
95

106
@custom-variant dark (&:where(.dark, .dark *));
117

src/components/Container.vue

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
<script setup>
2-
defineProps({
3-
spacedMobile: {
2+
const props = defineProps({
3+
fluid: {
44
type: Boolean,
5-
default: true,
5+
default: false,
66
required: false,
77
},
8-
fluid: {
8+
vertical: {
9+
type: Boolean,
10+
default: false,
11+
required: false,
12+
},
13+
flushMobile: {
914
type: Boolean,
1015
default: false,
1116
required: false,
@@ -14,7 +19,16 @@ defineProps({
1419
</script>
1520

1621
<template>
17-
<div :class="[{ 'max-w-(--breakpoint-2xl) mx-auto': !fluid }, spacedMobile ? 'px-4' : 'px-0', 'md:px-8']">
22+
<div
23+
class="md:px-8"
24+
:class="[
25+
{
26+
'max-w-(--breakpoint-2xl) mx-auto': !props.fluid,
27+
'py-4 md:py-8 space-y-4 md:space-y-8': props.vertical
28+
},
29+
props.flushMobile ? 'px-0' : 'px-4',
30+
]"
31+
>
1832
<slot />
1933
</div>
20-
</template>
34+
</template>

0 commit comments

Comments
 (0)