Download the PHP package timothyasp/nova-badge-field without Composer
On this page you can find all versions of the php package timothyasp/nova-badge-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download timothyasp/nova-badge-field
More information about timothyasp/nova-badge-field
Files in timothyasp/nova-badge-field
Informations about the package nova-badge-field
Laravel Nova Badge Field
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
Index
Installation
You can install the package in to a Laravel app that uses Nova via composer:
For Nova v1 - v3 support, use "timothyasp/nova-badge-field": "^1.04"
in your composer.json
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.
If you prefer to use the label
as the display text on the index and detail pages, you can use
the ->displayUsingLabels()
option.
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.
Credits
Built for QuizGriz - the #1 online trivia and quiz game site
License
The MIT License (MIT). Please see License File for more information.