ButtonGroup
A specialized container that holds buttons, displaying them in a tightly joined horizontal group with shared borders. Only Button widgets are allowed as children — adding other widget types will throw an exception. Use toggleGroup or toggleable to turn the group into a toggle bar where one or more buttons can be pressed at a time. The visual style of all buttons can be set uniformly with the rendition config.
new ButtonGroup({
toggleGroup : true,
items : [
{ icon : 'fa fa-align-left', pressed : true },
{ icon : 'fa fa-align-center' },
{ icon : 'fa fa-align-right' }
]
});
Useful configs, properties, and events
| Config / Event | Description |
|---|---|
| items | Array of button configs or Button instances |
| color | Default color applied to all contained buttons |
| toggleGroup | Enable toggle-group behavior for all buttons |
| toggleable | Min/max range of simultaneously pressed buttons |
| rendition | Visual style: 'filled', 'outlined', 'tonal', 'text', etc. |
| click | Fired when a button in the group is clicked |
| toggle | Fired when a button's pressed state changes |
See also
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Default color to apply to all contained buttons, see Button#color. Individual buttons can override the default.
-
An array of Buttons or typed Button config objects.
-
Set to
trueto turn the ButtonGroup into a toggle group, assigning a generated value to each contained buttons toggleGroup config. Individual buttons can override the default. -
If you use gaps between your buttons, set this to
true(controls whether to use border-radius for the button elements)
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of ButtonGroup class, or subclass thereof.
-
Identifies an object as an instance of ButtonGroup class, or subclass thereof.