PHPackages                             inspheric/nova-indicator-field - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. inspheric/nova-indicator-field

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

inspheric/nova-indicator-field
==============================

A Laravel Nova indicator field.

v1.43(6y ago)128966.2k↑64.6%13[4 issues](https://github.com/inspheric/nova-indicator-field/issues)[1 PRs](https://github.com/inspheric/nova-indicator-field/pulls)1MITPHPPHP &gt;=7.1.0

Since Aug 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/inspheric/nova-indicator-field)[ Packagist](https://packagist.org/packages/inspheric/nova-indicator-field)[ RSS](/packages/inspheric-nova-indicator-field/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)DependenciesVersions (9)Used By (1)

Laravel Nova Indicator Field
============================

[](#laravel-nova-indicator-field)

A colour-coded indicator field for Laravel Nova

[![Latest Version on Packagist](https://camo.githubusercontent.com/c1ee5338a81dcafc4fce04a135eed7a220120e873e6f5c898ea99b20bb58e490/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e737068657269632f6e6f76612d696e64696361746f722d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/inspheric/nova-indicator-field)[![Total Downloads](https://camo.githubusercontent.com/bec3a3aacb1fa6699d0817843ffd46df2cbcf464f2f4889bee5e3703f997ee5f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e737068657269632f6e6f76612d696e64696361746f722d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/inspheric/nova-indicator-field)

Installation
------------

[](#installation)

Install the package into a Laravel app that uses [Nova](https://nova.laravel.com) with Composer:

```
composer require inspheric/nova-indicator-field
```

Usage
-----

[](#usage)

Add the field to your resource in the `fields` method:

```
use Inspheric\Fields\Indicator;

Indicator::make('Status'),
```

The field extends the base `Laravel\Nova\Fields\Field` field, so all the usual methods are available.

### Options

[](#options)

#### Labels

[](#labels)

Add your desired status labels:

```
Indicator::make('Status')
    ->labels([
        'banned' => 'Banned',
        'active' => 'Active',
        'invited' => 'Invited',
        'inactive' => 'Inactive',
    ])
```

The array key is the raw field value and the array value is the desired label.

You can, of course use the Laravel `trans()` or `__()` functions to translate the labels.

If a label is not defined for a value that appears in the field, the "unknown" label will be used (see below).

#### Without Labels

[](#without-labels)

If you do not need to specify a different label, you can simply display the raw field value:

```
Indicator::make('Status')
    ->withoutLabels()
```

#### Unknown Label

[](#unknown-label)

Specify the label when the raw field value does not correspond to one of the labels you defined:

```
Indicator::make('Status')
    ->unknown('Unknown')
```

You can, of course use the Laravel `trans()` or `__()` functions to translate the unknown label.

If this is not set, an em dash will be displayed instead.

This setting does not apply when `withoutLabels()` has been used. In that case, an unknown label will display with its raw value.

#### Should Hide

[](#should-hide)

The indicator can be hidden if the field value is equal to a given value(s) or a callback:

```
Indicator::make('Status')
    ->shouldHide('active')
```

```
Indicator::make('Status')
    ->shouldHide(['invited', 'requested'])
```

```
Indicator::make('Status')
    ->shouldHide(function($value) {
        return $value == 'inactive';
    })
```

This is useful if you only want to highlight particular values in the grid and hide others, e.g. you want banned users to be displayed with a red indicator and label, and for active (not banned) users, you don't want the indicator displayed at all.

#### Should Hide If No

[](#should-hide-if-no)

The indicator can be hidden if the field value is anything that PHP considers as falsy, i.e. `false`, `0`, `null` or `''`:

```
Indicator::make('Status')
    ->shouldHideIfNo()
```

This is a shortcut for a common scenario for the above `shouldHide()` method.

#### Colours

[](#colours)

##### Named Colours

[](#named-colours)

Add your desired status colours:

```
Indicator::make('Status')
    ->colors([
        'banned' => 'red',
        'active' => 'green',
        'invited' => 'blue',
        'inactive' => 'grey',
    ])
```

The array key is the raw field value and the array value is the desired colour.

If a colour is not specified for a status, it will be displayed as grey.

The available colours are the default "base" colours from [Tailwind](https://tailwindcss.com/docs/colors), with the addition of black:

- 'black' `#22292F`
- 'grey' or 'gray' `#B8C2CC`
- 'red' `#E3342F`
- 'orange' `#F6993F`
- 'yellow' `#FFED4A`
- 'green' `#38C172`
- 'teal' `#4DC0B5`
- 'blue' `#3490DC`
- 'indigo' `#6574CD`
- 'purple' `#9561E2`
- 'pink' `#F66D9B`

As well as the following Nova variable colours:

- 'success' `var(--success)`
- 'warning' `var(--warning)`
- 'danger' `var(--danger)`
- 'info' `var(--info)`

Colour classes are not validated against the lists above, so if you enter an invalid colour, it will fall back to grey.

##### Literal Colours

[](#literal-colours)

You can also use your own hexadecimal, RGB/RGBA or HSL/HSLA literal colours or variables, as in CSS:

```
Indicator::make('Status')
    ->colors([
        '...' => '#ff0000',
        '...' => 'rgb(0, 255, 0)',
        '...' => 'rgba(0, 0, 0, 0.5)',
        '...' => 'hsl(120, 100%, 50%)',
        '...' => 'hsla(120, 100%, 50%, 0.5)',
        '...' => 'var(--success)',
    ])
```

Literal colours are not validated, so if you enter an invalid CSS colour, it will fall back to grey.

##### Additional Colour Classes

[](#additional-colour-classes)

If you want to specify your own colours as reusable classes, you can serve your own CSS file using Nova's Asset functionality. The classes must be prefixed with `indicator-`:

```
.indicator-yourcolourname {
    background: #000000;
}
```

Which you would use in the field definition without the 'indicator-' prefix, as:

```
Indicator::make('Status')
    ->colors([
        'yourstatus' => 'yourcolourname',
    ])
```

Appearance
----------

[](#appearance)

The field is displayed similarly to the built-in `Laravel\Nova\Fields\Boolean` field, with the ability to have more than a true/false value, and different labels and colours defined.

### Index

[](#index)

[![index-field](https://raw.githubusercontent.com/inspheric/nova-indicator-field/master/docs/index-field.png)](https://raw.githubusercontent.com/inspheric/nova-indicator-field/master/docs/index-field.png)

### Detail

[](#detail)

[![detail-field](https://raw.githubusercontent.com/inspheric/nova-indicator-field/master/docs/detail-field.png)](https://raw.githubusercontent.com/inspheric/nova-indicator-field/master/docs/detail-field.png)

### Form

[](#form)

(Same as detail.)

The indicator is not displayed on forms by default. If you choose to display it as a form field with `showOnUpdate()`, the indicator is not editable and does not write back to the server, as it is intended to come from a read-only or derived model attribute.

If you do need an editable status field, you might want to add your own additional `Laravel\Nova\Fields\Select` field to your resource, referencing the same attribute name, and with `onlyOnForms()` set.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity53

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~73 days

Total

8

Last Release

2306d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f364bd82fe8c6144a74ee2b6bce92be53b8833f31fef37863e863e2dccdf07f6?d=identicon)[inspheric](/maintainers/inspheric)

---

Top Contributors

[![kitbs](https://avatars.githubusercontent.com/u/4569320?v=4)](https://github.com/kitbs "kitbs (24 commits)")

---

Tags

laravellaravel-novalaravel-nova-fieldlaravel-packagenovalaravelfieldstatusindicatornova

### Embed Badge

![Health badge](/badges/inspheric-nova-indicator-field/health.svg)

```
[![Health](https://phpackages.com/badges/inspheric-nova-indicator-field/health.svg)](https://phpackages.com/packages/inspheric-nova-indicator-field)
```

###  Alternatives

[timothyasp/nova-color-field

A Laravel Nova Color Picker field.

781.6M5](/packages/timothyasp-nova-color-field)[alexwenzel/nova-dependency-container

A Laravel Nova 4 form container for grouping fields that depend on other field values.

461.0M2](/packages/alexwenzel-nova-dependency-container)[simplesquid/nova-enum-field

A Laravel Nova field to add enums to resources.

52391.9k2](/packages/simplesquid-nova-enum-field)[sietse85/nova-button

(Nova 4+) A Laravel Nova package for adding buttons to your resources.

37347.3k](/packages/sietse85-nova-button)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

51174.8k1](/packages/inspheric-nova-defaultable)[optimistdigital/nova-notes-field

This Laravel Nova package adds a notes field to Nova's arsenal of fields.

52139.5k](/packages/optimistdigital-nova-notes-field)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
