# How to deactivate a UI element in an add-on?

In an add-on I would like to have a property adjustable via its UI element, but when I have a second elements enabled I want my first element to be disabled : only show the information without being editable. It there a way to make a UI element read-only ? (grayed out / disabled / visible but un-editable).

Try:

col = layout.column()
col.enabled = False
# Use col.prop, col.operator, etc. Everything you add to this column will be faded


col.active is also possible, it will grey out the column but the props will still be editable (this is probably not something you want)

• Actually the attribute i think I was looking for is enabled so the solution is more like col.enabled = False. Also if want only one property to be enabled/disabled I need to put just that property inside of a col/box/row UI element and then hide the col/box/row. Nov 15, 2015 at 1:11
• What about a specific item in a row? so maybe there is a randomize checkbox beside a color well. The box disabled the well. Seems only if it's on a separate row or hide it? but I want to see the randomized color in the well. Nov 13, 2018 at 11:04
• I thought this was a toggle at first (i.e. set enabled back to True after calling prop()), but you actually disable everything in the layout component or nothing at all. I had to create an extra row() to control just a single component.
– Zyl
Sep 22, 2021 at 22:03