1616from .widget_description import DescriptionWidget
1717from .valuewidget import ValueWidget
1818from .widget_core import CoreWidget
19- from .widget import register
19+ from .widget_style import Style
20+ from .trait_types import InstanceDict
21+ from .widget import register , widget_serialization
2022from traitlets import (Unicode , Bool , Int , Any , Dict , TraitError , CaselessStrEnum ,
2123 Tuple , List , Union , observe , validate )
2224from ipython_genutils .py3compat import unicode_type
@@ -272,6 +274,11 @@ def _repr_keys(self):
272274 for key in sorted (chain (keys , ('options' ,))):
273275 yield key
274276
277+ @register
278+ class ToggleButtonsStyle (Style , CoreWidget ):
279+ """Button style widget."""
280+ _model_name = Unicode ('ToggleButtonsStyleModel' ).tag (sync = True )
281+ button_width = Unicode (help = "The width of each button." ).tag (sync = True )
275282
276283@register
277284class ToggleButtons (_Selection ):
@@ -284,6 +291,7 @@ class ToggleButtons(_Selection):
284291
285292 tooltips = List (Unicode (), help = "Tooltips for each button." ).tag (sync = True )
286293 icons = List (Unicode (), help = "Icons names for each button (FontAwesome names without the fa- prefix)." ).tag (sync = True )
294+ style = InstanceDict (ToggleButtonsStyle ).tag (sync = True , ** widget_serialization )
287295
288296 button_style = CaselessStrEnum (
289297 values = ['primary' , 'success' , 'info' , 'warning' , 'danger' , '' ],
0 commit comments