Laravel Community Tools by Tighten
Laravel Nova icon Nova Packages

Readme

Laravel Nova Color Field

Now works with Laravel Nova v4!


If you still are using Nova v1-v3, use v1.0.4 of this field.

Dead simple Laravel Nova Color field. Includes a color picker from the vue-color component.

Details Page

details page color input

Index

index color

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require timothyasp/nova-color-field

Usage

In your resource class, add the following to your fields method:

use Timothyasp\Color\Color;

....

Color::make("Field");

This will add the color picker to your resource, using vue-color's "slider" component by default. If you'd like to leverage another vue-color component, you can do so by calling that component's name as a method after Color::make():

use Timothyasp\Color\Color;

....

Color::make('Field')->compact()
// or
Color::make('Field')->slider()

and so on. You can use any one of: chrome, compact, grayscale, material, photoshop, sketch, slider, swatches, twitter.

Palette support for adding custom colors to some of the pickers is also available:

Color::make('Field')->compact()->palette(['#beaf00', '#DEADAF', '#000']);

Credits

Built for QuizGriz - the #1 online trivia and quiz game site

License

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

Reviews

By Bryan on October 5, 2022

Thank you for this package ! Just got few points I discovered: Would be nice to hide the color picker and show it up only after a click. The readonly() is not working. The input is not reactive with whatever HEX you put inside, it won't change the little square color.

By Carlos Cuamatzin Hernández on January 20, 2022

Amazing, maybe the color picker needs to be hidden until you click the field but it works perfectly. You can select all the colors, just need to switch bettween chrome, compact, grayscale, material, photoshop, sketch, slider, swatches

By codeurient on August 19, 2021

There are not all colors

Back to Top
Added 7 years ago
Last updated 2 Years Ago
Version v2.0.2
Composer
timothyasp/nova-color-field
GitHub stars 77
Packagist downloads 1,581,785

Favorites

23 users favorited

Rating

4.60
(out of 5)
★★★★★
★★★★
★★★
★★
14 ratings

Author

Contributors

Tags

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas