gabrielesbaiz/nova-field-indicator
| Install | |
|---|---|
composer require gabrielesbaiz/nova-field-indicator |
|
| Latest Version: | 1.0.0 |
| PHP: | ^8.0 |
| License: | MIT |
| Last Updated: | Apr 10, 2026 |
| Links: | GitHub · Packagist |
NovaField Indicator
A colour-coded status indicator for Laravel Nova — a dot, ring, square or pill that reads a value and shows what it means, configured from the enum your application already has.
📖 Read the documentation →
Every method, every config key, and a live palette page where picking a shape, size and shade rewrites the PHP call as you click it.
[!CAUTION] Upgrading from 1.x? Read UPGRADE.md first. On Nova 5 the
success,danger,warningandinfocolours rendered an invisible dot — they now appear, so columns that looked empty will fill with colour. Named colours also move from the Tailwind v1 palette to Tailwind 3.php artisan nova-field-indicator:upgrade --dry-runpreviews the rest.
[!IMPORTANT] A ⭐ costs you nothing and helps other developers find this package. Sponsoring keeps it compatible with every new Laravel and Nova release.
What it does
Nova ships Badge, which is good at four hard-coded states. This is for the rest:
a status column whose colours are yours, whose states come from an enum, and which
still reads correctly in dark mode and to a screen reader.
- Enum-first.
->enum(Status::class)derives labels, colours and icons from one enum. If the attribute is already enum-cast and the enum implements the contracts, the field needs no configuration at all. - The whole palette. Any Tailwind family and shade, light/dark pairs, or literal
CSS colours — resolved against Nova's own
--colors-*variables, so re-theming Nova re-themes every indicator. - Four shapes and three sizes, plus optional heroicons that cost nothing extra in the bundle because they are Nova's own.
- Continuous values via
->ranges(), for scores, percentages and stock levels. - An index filter with
->filterable(), built from your states or your enum. - Accessible by default — colour is never the only channel, and a label-less mark is still a named graphic.
- Resolved on the server, so an index ships one small object per row instead of your entire configuration repeated per cell.
- 1.07 kB of JavaScript gzipped, with no runtime dependency of its own.
Requirements
- PHP 8.3+
- Laravel 12 or 13
- Nova 5.11+ — Nova 6 is explicitly conflicted;
configureDefaults(), the hook the field applies its display-only defaults through, arrived in 5.11
Installation
composer require gabrielesbaiz/nova-field-indicator
Optionally publish the config and translations:
php artisan vendor:publish --tag=nova-field-indicator-config
php artisan vendor:publish --tag=nova-field-indicator-lang
Quick start
use Gabrielesbaiz\NovaFieldIndicator\NovaFieldIndicator;
NovaFieldIndicator::make('Status')
->enum(Status::class)
->withIcons()
->filterable(),
Everything else is on the documentation site.
Testing
composer check # Pint + PHPStan level 6 + Pest
npm test # Vitest
Contributing
Please see CONTRIBUTING for details.
Security
Please review our security policy on how to report security vulnerabilities.
Credits
- Oleg Khalin — the original nova4-indicator-field
- Gabriele Sbaiz
- All Contributors
Support this package
If it saves you time, consider sponsoring.
License
The MIT License (MIT). Please see License File for more information.
Related Packages
A lightweight helper package to handle Eloquent model duplication.
Generate memorable, human-friendly passwords from curated dictionaries, in any l...