A large animated number readout that counts to its value.
Import¶
from manywidgets import NumberDisplayExample¶
Read-only — drive it from another widget (see the linking guide). Drag the slider to watch it count:
from ipywidgets import jsdlink
from manywidgets import Slider, NumberDisplay
s = Slider(label="Drag me", min=0, max=1000, value=250)
nd = NumberDisplay(label="Selected", format="{:,.0f}", duration=400)
jsdlink((s, "value"), (nd, "value"))
display(s, nd)API¶
| Trait | Type | Default | Description |
|---|---|---|---|
value | Float | 0.0 | Target value (animates to it). |
format | Unicode | '{}' | Format spec: “{}”, “{:.1f}”, “{:,}”, “{:,.0f}”. |
duration | Int | 600 | Animation duration in ms (0 = instant). |
label | Unicode | '' | Label shown above the number. |
widget_id | Unicode | '' | Stable unique id used for cross-widget linking (auto-assigned). |