timothyasp/nova-color-field

A Laravel Nova Color Picker field.
1,774,585 76
Install
composer require timothyasp/nova-color-field
Latest Version:v2.0.2
PHP:>=7.1.0
License:MIT
Last Updated:Jul 5, 2023
Links: GitHub  ·  Packagist
Maintainer: timothyasp

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.

Related Packages

silvanite/novafieldcheckboxes

A Laravel Nova field to display a number of multi-select options using checkboxe...

885,753 67
whitecube/nova-flexible-content

Flexible Content & Repeater Fields for Laravel Nova.

3,442,073 805
inspheric/nova-indicator-field

A Laravel Nova indicator field.

1,015,999 128
inspheric/nova-url-field

A Laravel Nova url field.

1,320,237 102
davidpiesse/nova-toggle

A Boolean Toggle Switch Field

1,131,913 86