Search by

gabrielesbaiz / nova-field-indicator

gabrielesbaiz

A colour-coded status indicator field for Laravel Nova, with enum-first configuration, shapes, icons, dark mode and index filtering.

Package info

github.com/gabrielesbaiz/nova-field-indicator

pkg:composer/gabrielesbaiz/nova-field-indicator

Fund package maintenance!

gabrielesbaiz

Statistics

Installs: 16 550

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

2.0.1 2026-09-28 10:12 UTC

This package is auto-updated.

Last update: 2026-09-28 10:13:04 UTC


README

NovaField Indicator

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.

Latest version PHP Laravel Downloads Stars Sponsor

📖 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, warning and info colours 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-run previews 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

Support this package

If it saves you time, consider sponsoring.

License

The MIT License (MIT). Please see License File for more information.