PHPackages                             webard/nova-badge-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. webard/nova-badge-field

ActiveLibrary

webard/nova-badge-field
=======================

A Laravel Nova field.

v2.1.1(1y ago)01.8k↓100%MITJavaScriptPHP &gt;=7.1.0

Since Sep 25Pushed 1y agoCompare

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

READMEChangelogDependencies (2)Versions (4)Used By (0)

Laravel Nova Badge Field
========================

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

**NOTE**: This has been forked from [timothyasp/nova-badge-field](https://github.com/timothyasp/nova-badge-field), see [PR #20](https://github.com/timothyasp/nova-badge-field/pull/20)

Works with Nova 4!

---

This is a simple Laravel Nova Badge field. It extends the `Select` field and allows a simple mapping of colors to values to display a "Badge" on the index and details pages. Can be customized with tailwind classes

### Details Page

[](#details-page)

[![details page select](https://camo.githubusercontent.com/2bf84259d95305cef3b8b7e83c4f63b833eeb89d98eecc006146faed92330475/68747470733a2f2f63646e2d70726f2e64707263646e2e6e65742f66696c65732f6163635f3436353631322f53354d447169)](https://camo.githubusercontent.com/2bf84259d95305cef3b8b7e83c4f63b833eeb89d98eecc006146faed92330475/68747470733a2f2f63646e2d70726f2e64707263646e2e6e65742f66696c65732f6163635f3436353631322f53354d447169)

### Index

[](#index)

[![index badge](https://camo.githubusercontent.com/ffc6163ec39e150b4bddc6171d5203970c400f69137c8de36decf25a209243a0/68747470733a2f2f63646e2d70726f2e64707263646e2e6e65742f66696c65732f6163635f3436353631322f676962676a44)](https://camo.githubusercontent.com/ffc6163ec39e150b4bddc6171d5203970c400f69137c8de36decf25a209243a0/68747470733a2f2f63646e2d70726f2e64707263646e2e6e65742f66696c65732f6163635f3436353631322f676962676a44)

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

[](#installation)

You can install the package in to a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require timothyasp/nova-badge-field
```

For Nova v1 - v3 support, use `"timothyasp/nova-badge-field": "^1.04"` in your `composer.json`

Usage
-----

[](#usage)

In addition to any of the `Select` field options and presentation methods, here are a few `Badge` specific customizations this package provides.

To customize the text color of the badge, set the `color` attribute on the option. If there isn't an option set, it defaults to setting the background color and the text color is set to a contrasting white/black color based on the brightness of the background.

```
use Timothyasp\Badge\Badge;

$options = [
    'option1' => 'Option 1',
    'option2' => 'Option 2'
];

Badge::make('Field')
   ->options($options)
   ->colors([
      'option1' => '#ffffff',
      'option2' => '#000000'
   ]);

```

If you prefer to use the `label` as the display text on the index and detail pages, you can use the `->displayUsingLabels()` option.

```
use Timothyasp\Badge\Badge;

$options = [
  'Option 1' => 1,
  'Option 2' => 2
];

Badge::make('Field')
   ->options($options)
   ->colors([
      'Option 1' => '#ffffff',
      'Option 2' => '#000000'
   ])->displayUsingLabels();

```

Finally, if you need even more customization on the badge display, use the `extraClasses` method to pass along any additional Tailwind classes to customize the appearance of the `Badge`.

This is useful if you'd like to customize the badges to be stacking instead of inline, when using the `Stack` field.

```
use Timothyasp\Badge\Badge;

$options = [
    'option1' => 'Option 1',
    'option2' => 'Option 2'
];

Badge::make('Field')
    ->options($options)
    ->extraClasses('mr-2 text-4xl flex');

```

Credits
-------

[](#credits)

- [Timothy Asp](https://github.com/timothyasp)
- [@timcv](https://github.com/timcv)
- [@batFormat](https://github.com/batFormat)
- [@ShaneShipston](https://github.com/ShaneShipston)

Built for [QuizGriz - the #1 online trivia and quiz game site](https://grizly.com)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 55.6% 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 ~0 days

Total

2

Last Release

590d ago

### Community

Maintainers

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

---

Top Contributors

[![timothyasp](https://avatars.githubusercontent.com/u/707699?v=4)](https://github.com/timothyasp "timothyasp (15 commits)")[![webard](https://avatars.githubusercontent.com/u/855788?v=4)](https://github.com/webard "webard (7 commits)")[![batFormat](https://avatars.githubusercontent.com/u/13119245?v=4)](https://github.com/batFormat "batFormat (4 commits)")[![ShaneShipston](https://avatars.githubusercontent.com/u/367758?v=4)](https://github.com/ShaneShipston "ShaneShipston (1 commits)")

---

Tags

laravelnova

### Embed Badge

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

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

###  Alternatives

[eminiarts/nova-tabs

Laravel Nova - Tabs.

4624.1M20](/packages/eminiarts-nova-tabs)[oneduo/nova-file-manager

A handy file manager tool for Laravel Nova

157350.3k2](/packages/oneduo-nova-file-manager)[mostafaznv/nova-ckeditor

CkEditor for Laravel Nova

57327.2k1](/packages/mostafaznv-nova-ckeditor)[bbs-lab/nova-file-manager

A handy file manager tool for Laravel Nova

1578.0k](/packages/bbs-lab-nova-file-manager)[outl1ne/nova-table-field

Table field for Laravel Nova

4057.9k](/packages/outl1ne-nova-table-field)[digital-creative/icon-action-toolbar

Allows you to update a single column of a resource all at once.

2626.0k](/packages/digital-creative-icon-action-toolbar)

PHPackages © 2026

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