# Can a listbox item be highlighted based on a condition?

**URL:** <https://forum.inductiveautomation.com/t/can-a-listbox-item-be-highlighted-based-on-a-condition/77964>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [August 16, 2023, 10:00pm UTC](https://forum.inductiveautomation.com/t/can-a-listbox-item-be-highlighted-based-on-a-condition/77964 "2023-08-16T22:00:39Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [August 19, 2023, 11:20am UTC](https://forum.inductiveautomation.com/t/can-a-listbox-item-be-highlighted-based-on-a-condition/77964/5 "2023-08-19T11:20:05Z")

</div>

Yes; this should be doable with the list cell renderer. Here is [an example I developed for simply changing the dropdown background color independent of the component color](https://forum.inductiveautomation.com/t/change-the-background-and-icon-color-of-the-dropdown-components-button/70617/2)

Looking at the code in that example. The part to modify for your use case would be this:

```auto
if cellHasFocus or isSelected:
	component.background = event.source.selectionBackground
else:
	component.background = Color.black

```

Just add some elif statements to for highlighting values greater than zero or for changing fonts. Note the variables that are passed into renderer component that can be used in your scripting:

```auto
(self, list, value, index, isSelected, cellHasFocus)

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/can-a-listbox-item-be-highlighted-based-on-a-condition/77964)._
