slider class
Displays and allows the user to set a value within a range.
Methods¶
__init__() ¶
__init__(
value=None,
min=0,
max=100,
step=1,
text_anchor="bottom",
labels=None,
continuous=True,
change_delay=None, # App config
width="300px",
height=None,
orientation="horizontal",
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 slider
element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
Union[int,float,str,list[int],list[float],list[str]]
|
The value that is set for this slider. |
None
|
min |
Union[int, float]
|
The minimum value. |
0
|
max |
Union[int, float]
|
The maximum value. |
100
|
step |
Union[int, float]
|
The step value, which is the gap between two consecutive values the slider set. It is a good practice to have (max-min) being divisible by step. |
1
|
text_anchor |
str
|
When the lov property is used, this property indicates the location of the label.
|
bottom
|
labels |
Union[bool, dict[str, str]]
|
The labels for specific points of the slider. |
None
|
continuous |
bool
|
If set to False, the control emits an on_change notification only when the mouse button is released, otherwise notifications are emitted during the cursor movements. |
True
|
change_delay |
int
|
Minimum time between triggering two on_change callbacks. |
App config
|
width |
str
|
The width of this slider, in CSS units. |
300px
|
height |
str
|
The height of this slider, in CSS units. |
None
|
orientation |
str
|
The orientation of this slider. |
horizontal
|
lov |
dict[str, Any]
|
The list of values. See the section on List of Values for more details. |
None
|
adapter |
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)
|
type |
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
|
value_by_id |
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
|
on_change |
Union[str, Callable]
|
A function or the name of a function that is triggered when the value is updated.
|
None
|
propagate |
bool
|
Allows the control's main value to be automatically propagated. |
App config
|
active |
bool
|
Indicates if this component is active. |
True
|
id |
str
|
The identifier that is assigned to the rendered HTML component. |
None
|
properties |
dict[str, Any]
|
Bound to a dictionary that contains additional properties for this element. |
None
|
class_name |
str
|
The list of CSS class names that are associated with the generated HTML Element. |
None
|
hover_text |
str
|
The information that is displayed when the user hovers over this element. |
None
|