As @pbugnion notes below, we should document the indent parameter in the checkbox section of the ipywidgets list in the documentation.
Original title: extra space in checkbox
Use this code to display a checkbox in notebook. There is some leading space in the checkbox.
import ipywidgets as widgets
from IPython.display import display
check_box = widgets.Checkbox(description="abcd", value=True, layout=widgets.Layout(width="120px"))
display(check_box)

ipywidgets 7.0.1
Ubuntu FireFox 56.0
Before 7.0.1, I installed ipywidgets both in pip and conda, and I updated ipywidgets with conda, then I have to pip uninstall old ipywidgets 6.0.0 and widgetsnbextension 2.0.0. I'm not sure if this is related to this issue.
Thanks for raising this.
The checkbox supports an indent traitlet that you can set to False:
widgets.Checkbox(
description="abcd",
value=True,
indent=False
)
The rationale for having an indent is so that, when you put checkboxes in a VBox with other controls, they line up correctly:

In terms of actions on this issue, I note that the docstring for Checkbox has information about the indent, but the documentation does not.
Maybe we should mention this in the documentation?
Maybe we should mention this in the documentation?
+1. I'll change the issue to reflect that.
Most helpful comment
Thanks for raising this.
The checkbox supports an
indenttraitlet that you can set to False:The rationale for having an
indentis so that, when you put checkboxes in a VBox with other controls, they line up correctly:In terms of actions on this issue, I note that the docstring for
Checkboxhas information about theindent, but the documentation does not.Maybe we should mention this in the documentation?