So here is a example Panel and adding a boolean,

import bpy
from bpy.props import BoolProperty

bpy.types.Scene.Boolean= BoolProperty(
        default = True)

class Example_Panel(bpy.types.Panel):
    bl_label = "Example"
    bl_category = "Example"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def draw(self, context):
        layout = self.layout
        sce = context.scene
        layout.prop(sce, "Boolean")

def register():

def unregister():

if __name__ == "__main__":

so that would give a check like this,

Boolean Example

and to add a icon,

layout.prop(sce, "Boolean", icon = 'CHECKMARK')

that would give this,


so I don't want an icon and at the same time I want a a button like the latter picture.

So far, I do this to not put a Icon to my booleans,

layout.prop(sce, "Boolean", icon = 'BLANK1')

It gives this,

Solution for now

But there is a offset to the right which I don't want, so how would I do this?


1 Answer 1


In the API Documentation it says:

toggle (int in [-1, 1], (optional)) – Use toggle widget for boolean values, or a checkbox when disabled (the default is -1 which uses toggle only when an icon is displayed)

So you can use:

layout.prop(sce, "Boolean", toggle = 1)

Which gives you exactly what you want:

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.