Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Torpedo's avatar

Nova Index row background color

Is there a way to change the background color of the index row based on some condition?

something like.. if resource has status canceled, background color red... how could i do this with nova?

0 likes
3 replies
aurawindsurfing's avatar
Level 50

Hi @torpedo

I would try using asHtml method:

Text::make('Status', function () {
    return view('partials.status', [
        'is_passing' => $this->isPassing(),
    ])->render();
})->asHtml()

It is described here: https://nova.laravel.com/docs/1.0/resources/fields.html#computed-fields

Since tailwindcss is all within your html you might be able to stick some timple logic in there.

Other then that I would look at one of custom nova packages and how they do this.

Hope it helps!

Please or to participate in this conversation.