Widget properties

All widgets controls have a set of properties for your display that can be adjusted as needed. You can see the list of properties by taking an instance of a control and running the control.keys command in a Notebook, as can be seen in the following example:

from ipywidgets import * 
w = IntSlider() 
w.keys 

This script pulls in a blanket reference to all of the controls available in widgets. We then create an IntSlider instance and display the list of properties that we can adjust. So, we end up with a display like the following screenshot:

As you can see, the list is extensive:

Property

Description

orientation

Whether left align, right align or justified

color

Color of font

height

Height of control

disabled

Whether control is disabled or not

visible

Is the control displayed?

font_style

Style of font, for example, italic

min

Minimum value (used in range list)

background_color

Background color of control

width

Width of control

font_family

Font family to be used for text in control

description

The description field is used for documentation purposes

max

Maximum value (of range)

padding

Padding applied (to edges of control)

font_weight

Weight of font used in control, for example, bold

font_size

Size of font used for text in control

value

Selected and entered value for control

margin

Margin to use when displaying control

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.103.10