Ipywidgets: Document the extra space in checkbox in the ipywidgets list

Created on 15 Oct 2017  路  2Comments  路  Source: jupyter-widgets/ipywidgets

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)

checkbox

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.

docs good first issue

Most helpful comment

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:

screen shot 2017-10-16 at 06 29 23


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?

All 2 comments

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:

screen shot 2017-10-16 at 06 29 23


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.

Was this page helpful?
0 / 5 - 0 ratings