How to do buttons for list in the UI?

Hello,
How to do a button like that?


I’m trying with EnumProperty but it shows items as a scroll list. Is it possible to display it like the BW/RGB/RGBA or 8/16 buttons ? Should I use another property?

Use an EnumProperty and where you add it to a panel, pass the argument expand=True to have it look like those two enums.

Thank you, I was looking wrong thinking it was maybe the subtype but it wasn’t that.