textual_countdown.countdown
Provides a visual countdown widget.
Countdown
Bases: Widget
A countdown widget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str | None
|
The name of the countdown widget. |
None
|
|
str | None
|
The ID of the countdown widget in the DOM. |
None
|
|
str | None
|
The CSS classes of the countdown widget. |
None
|
|
bool
|
Whether the countdown widget is disabled or not. |
False
|
COMPONENT_CLASSES
class-attribute
instance-attribute
COMPONENT_CLASSES = {'countdown--remaining'}
Class | Description |
---|---|
countdown--remaining |
Targets the remaining portion of the countdown display. |
is_running
property
is_running
Is the countdown currently running?
Cancelled
dataclass
Cancelled(countdown)
CountdownMessage
dataclass
CountdownMessage(countdown)
Finished
dataclass
Finished(countdown, counting)
Timed
dataclass
Timed(countdown, counting)
Bases: CountdownMessage
Base class for messages that include a time value.
counting
instance-attribute
counting
The amount being counted.
cancel
cancel()
Cancel the countdown timer from running.
Note
When the countdown is cancelled a
Cancelled
message is
posted.