toggle class
A series of toggle buttons that the user can select.
Methods¶
__init__() ¶
__init__(
value=None,
theme=False,
allow_unselect=False,
unselected_value=None,
mode=None,
label=None,
width=None,
lov=None,
adapter=None, # lambda x: str(x)
type=None, # Type name of the first lov element
value_by_id=False,
on_change=None,
propagate=None, # App config
active=True,
id=None,
properties=None,
class_name=None,
hover_text=None,
) -> None
Create a new toggle
element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Any
|
Bound to the selection value. |
None
|
|
bool
|
If set, this toggle control acts as a way to set the application Theme (dark or light). |
False
|
|
bool
|
If set, this allows de-selection and the value is set to unselected_value. |
False
|
|
Any
|
Value assigned to value when no item is selected. |
None
|
|
str
|
Define the way the toggle is displayed:
|
None
|
|
str
|
The label associated with the toggle. |
None
|
|
Union[str, int]
|
The width of the element. |
None
|
|
dict[str, Any]
|
The list of values. See the section on List of Values for more details. |
None
|
|
Union[str, Callable]
|
A function or the name of the function that transforms an element of lov into a tuple(id:str, label:Union[str,Icon]). |
lambda x: str(x)
|
|
str
|
This property is required if lov contains a non-specific type of data (e.g., a dictionary).
The default value is the type of the first element in lov. |
Type name of the first lov element
|
|
bool
|
If False, the selection value (in value) is the selected element in lov. If set to True, then value is set to the id of the selected element in lov. |
False
|
|
Union[str, Callable]
|
A function or the name of a function that is triggered when the value is updated.
|
None
|
|
bool
|
Allows the control's main value to be automatically propagated. |
App config
|
|
bool
|
Indicates if this component is active. |
True
|
|
str
|
The identifier that is assigned to the rendered HTML component. |
None
|
|
dict[str, Any]
|
Bound to a dictionary that contains additional properties for this element. |
None
|
|
str
|
The list of CSS class names that are associated with the generated HTML Element. |
None
|
|
str
|
The information that is displayed when the user hovers over this element. |
None
|