timothyasp / nova-badge-field Goto Github PK
View Code? Open in Web Editor NEWSimple badge field for Laravel Nova
Simple badge field for Laravel Nova
Hey Tim,
I can't seem to replace the displayed value, with a label
Here's a snippet:
Badge::make('Tier', 'tier')
->options(['1' => 'T1', '2' => 'T2'])
->colors([
"1" => [
"background" => '#333,
"color" => '#fff',
],
"2" => [
"background" => '#fff',
"color" => '#333',
]
]),
I, for the life of me, can't seem to get T1/T2 to display over the colors key.
I'll write up a block for your README once we get this cleared up ;)
Hi!
I'm looking for a next thing.
I set color and background for 2 values, that I know they could be there.
And third value is a datetime, which could have any value, so I cant predict its value and add it to options array.
How to define common color for all these values that were not defined as known options?
For smaller badges that may not take up the entire column space, I tried adding Nova's built in methods:
->textAlign('center')
and ->withMeta(['textAlign' => 'center'])
However because the badges are using spans, they do not center inside the column correctly.
I imagine there is some custom css needed when text alignment changes are detected
I'm using this component to display a boolean field with green or red, but want to show a custom label (Active / Disabled). This component extends from select, should be easy to use displayUsingLabels feature. Thanks!
I've tried implementing this in a project in L7 + Nova 3.0 and it doesn't render any badges no matter how I set it up.
Is it possible it needs an update for nova 3.0?
Would be great if you could add the option to define the border / border-color:
->colors([
'option1' => [
'background' => '#ffffff',
'color' => '#ffa500',
'border-color' => '#ffa500' // default: 1px solid
'border' => '1px solid #ffa500', // full controll
],
or full style control:
->colors([
'option1' => [
'style' => 'color: #ffa500; border: 1px solid #ffa500'
],
or outline option, which uses color and background:
->outline()
e.g. to get an outline style like this
Hi @timothyasp,
Thank you for this package!
I am using this package to display/update the state of orders by administrators.
Consider the following states for an order:
cart
-> pending_payment
-> processing
-> completed
I want to disable options cart
and pending_payment
when an order state is `processing.
Is there any way to disable some displayed options?
in the docs dont specify the name to use on de nova resource.
Laravel Nova 4.16
Laravel 9.36
How do i set the text colour?
Is there an option to set the text colour and not rely on the contrast black/white?
Thanks.
Thanks so much for this package!
Noticed that it does not work as expected when combined with Nova's new Stack field (https://nova.laravel.com/docs/3.0/resources/fields.html#stack-field).
Instead of stacked, badges are shown side-by-side like as follows.
We are building a custom "ticket" system into an application, and stacked fields allow a greater visual density of information horizontally.
Hi,
is it possible to make the text of the badge alway white?
Hello,
I get the following error, when I try to use your Badge.
Badge not found.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.