Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

NumberDisplay

A large animated number readout that counts to its value.

Import

from manywidgets import NumberDisplay

Example

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

TraitTypeDefaultDescription
valueFloat0.0Target value (animates to it).
formatUnicode'{}'Format spec: “{}”, “{:.1f}”, “{:,}”, “{:,.0f}”.
durationInt600Animation duration in ms (0 = instant).
labelUnicode''Label shown above the number.
widget_idUnicode''Stable unique id used for cross-widget linking (auto-assigned).