starkit-laravel maintained by monstm
Starkit for Laravel
Laravel package that provides the Starkit admin dashboard template as Blade components and Tailwind v4 styles.
The package is not a standalone application. Your Laravel application supplies its own routes, data, models, authentication, and authorization.
Requirements
- PHP 8.3 or newer
- Laravel 13
- Tailwind CSS v4 and Vite in your application (
tailwindcss,@tailwindcss/vite,vite, andlaravel-vite-plugin; a new Laravel application already has them)
Installation
1. Install the package
composer require monstm/starkit-laravel
The service provider is discovered automatically.
2. Install the npm packages
npm install alpinejs @monstm/data-dom @fortawesome/fontawesome-free chart.js
| Package | Needed for |
|---|---|
alpinejs |
Required: interactive state |
@monstm/data-dom |
Required: click-driven data-* behaviour |
@fortawesome/fontawesome-free |
Icons: the components use Font Awesome classes |
chart.js |
Only for sk-chart and sk-sparkline (<x-starkit::chart> and <x-starkit::sparkline>) |
3. Publish the package files
php artisan vendor:publish --tag=starkit
This is the basic set: the logo and favicon, the config, the colour themes, and the partial views. See Publish tags for the others.
4. Set up the CSS
In resources/css/app.css:
@import 'tailwindcss';
@import '@fortawesome/fontawesome-free/css/all.css' layer(base);
@import '../../vendor/monstm/starkit-laravel/resources/css/starkit.css';
/* Your palette overrides. Import after starkit so they win. */
@import './themes/primary.css';
@import './themes/dominant.css';
@import './themes/success.css';
@import './themes/info.css';
@import './themes/warning.css';
@import './themes/danger.css';
/* Tell Tailwind where the package classes are, because it skips vendor/ by default. */
@source '../../vendor/monstm/starkit-laravel/resources/views';
@source '../../vendor/monstm/starkit-laravel/src';
Import Font Awesome into the base layer, so that Tailwind utilities on an icon (width, size) win over the Font Awesome defaults.
5. Set up the JavaScript
In resources/js/app.js:
import Alpine from 'alpinejs';
import { init as initDataDom } from '@monstm/data-dom';
import Chart from 'chart.js/auto';
import '../../vendor/monstm/starkit-laravel/resources/js/starkit.js';
window.Alpine = Alpine; // before Alpine.start()
window.Chart = Chart; // only for sk-chart and sk-sparkline
Alpine.start();
initDataDom();
Leave out the two Chart lines if you did not install Chart.js.
6. Create a page
For example resources/views/dashboard.blade.php:
<x-starkit::layout title="Dashboard">
<h1 class="text-2xl font-bold">Dashboard</h1>
<x-starkit::button text="Save" />
</x-starkit::layout>
Add a route for it in routes/web.php:
Route::view('/dashboard', 'dashboard');
Then build the assets with npm run dev or npm run build.
Publish tags
Run php artisan vendor:publish --tag=<tag>.
| Tag | Contents | Destination |
|---|---|---|
starkit |
Basic set: assets, config, themes, and partials | See the rows below |
starkit-all |
Everything: the basic set and the layouts | See the rows below |
starkit-assets |
Default logo and favicon | public/starkit/ |
starkit-config |
Package config | config/starkit.php |
starkit-themes |
Colour themes: primary, dominant, success, info, warning, danger |
resources/css/themes/ |
starkit-partials |
Sidebar, navbar, footer, notification menu, user menu, dark mode script | resources/views/vendor/starkit/partials/ |
starkit-layouts |
Layouts: blank, full-sidebar, full-navbar |
resources/views/vendor/starkit/components/layouts/ |
The layouts load the logo and the favicon from public/starkit/, so publish at least starkit-assets.
A published view replaces the package view, so later package updates do not reach it. Compare your copy with the package view after an update.
After a package update
Publish the assets again:
php artisan vendor:publish --tag=starkit-assets --force
Do not use --force with starkit or starkit-all unless you want to lose your changes to the published config, themes, and views. --force on starkit-assets also overwrites the files in public/starkit/, so keep your own logo and favicon under another path.
Configuration
Set these in .env, or edit the published config/starkit.php.
| Variable | Config key | Default |
|---|---|---|
STARKIT_LAYOUT_TYPE |
layout.type |
full-sidebar |
STARKIT_LOGO |
brand.logo |
starkit/logo.webp |
STARKIT_FAVICON |
brand.favicon |
starkit/favicon.ico |
STARKIT_LOADING_ICON |
loading_icon |
fa-solid fa-spinner fa-spin |
STARKIT_TOAST_POSITION |
toast.position |
top-right |
STARKIT_TOAST_MAX |
toast.max |
3 |
The logo and the favicon take a path under public/ or a full URL. The brand name is config('app.name').
Customisation
Colours
Edit the published files in resources/css/themes/, for example --color-primary-600. starkit.css already includes the default colours, so the application also works without the theme imports.
Sidebar, navbar, and footer
The partials hold example content: menu, notifications, user menu, and footer. Replace it with your own in resources/views/vendor/starkit/partials/. The user menu avatar is loaded from ui-avatars.com; allow that host if you use a Content Security Policy and keep the example.
Text
Built-in text of a component can be replaced through its props; text with a value in it uses %s. Text in the layouts and partials goes through __(), with the English text as the key.
JavaScript
window.Starkit holds the toast functions, escapeHtml, and two override points. Change them before Alpine.start():
Starkit.defaults.apiTableandStarkit.defaults.searchableSelect: data adapter defaults (headers,params,parse,map,request, andformatfor the API table). A component's ownconfigis merged over them.Starkit.darkMode: replaceget()andset(dark)to keep the dark mode choice somewhere other thanlocalStorage. Publish thepartials/dark-mode-scriptview and change it too, because it reads the choice before the first paint.
window.Starkit.defaults.apiTable.headers = { Authorization: 'Bearer ...' };
window.Starkit.defaults.apiTable.format = {
name: (value) => `<strong>${window.Starkit.escapeHtml(value)}</strong>`,
};
An API table format returns HTML, so it must escape user data with Starkit.escapeHtml.
Components
Use a component as <x-starkit::name>. Props, slots, and examples of every component, and the toast service, are in COMPONENTS.md.
| Group | Components |
|---|---|
| Layout | layout, sidebar-section, sidebar-group, sidebar-item, dark-mode-toggle |
| Actions | button, button-group, link, social-button |
| Data display | accordion, avatar, badge, card, list, timeline, chart, sparkline |
| Feedback | alert, empty-state, progress-bar, skeleton, spinner, toast-container |
| Forms | input, textarea, select, searchable-select, checkbox, radio, switch, input-group, floating-label, otp-input, date-range-picker, file-upload |
| Tables | table, data-table, api-table, tree-table |
| Navigation | breadcrumb, pagination, stepper, tab |
| Overlays | modal, drawer, dropdown, popover, tooltip, command-palette |
If a coding agent works on your application, add this to its instruction file (AGENTS.md or CLAUDE.md):
UI uses monstm/starkit-laravel. Before writing UI markup, read
vendor/monstm/starkit-laravel/COMPONENTS.md and use <x-starkit::...> components.