WidgetComponent¶
- class widgets.WidgetComponent(background_color: Color = None, corner_radius: float = 0.0, padding: Padding = None, link: str = None)¶
An abstract class that represents an UI element displayed in a widget.
WidgetComponentattributes can be modified after initialisation, but they can all be set from the initialiser. However, changes made to anWidgetComponentobject after being displayed won’t take effect.- background_color¶
The background color of the element.
- Return type:
- corner_radius¶
The radius to use when drawing rounded corners for the view’s background.
- Return type:
float
- padding¶
The padding around this component. Use a
Paddingpreset or a customPaddinginstance.
See
Padding.- Return type:
Union[int, widgets.Padding]
- link¶
A string that will be passed to the widget script when the element is tapped.
Set this attribute to make the element tappable.
When an element is tapped, the widget is executed in app and the
linkattribute is passed tolink. The element isn’t tappable if this attribute is set toNone.This attribute doesn’t take effect on small widgets.
- Return type:
str