Skip to content

Commit 5cf1ced

Browse files
committed
wording
1 parent c12fe83 commit 5cf1ced

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/tutorial.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,11 @@ A recurring theme in Textual is that you rarely need to explicitly update a widg
393393
It is possible: you can call [refresh()][textual.widget.Widget.refresh] to display new data.
394394
However, Textual prefers to do this automatically via _reactive_ attributes.
395395

396-
You can declare a reactive attribute with [reactive][textual.reactive.reactive].
397-
Let's use this feature to create a timer that displays elapsed time and keeps it updated.
396+
Reactive attributes work like any other attribute, such as those you might set in an `__init__` method, but allow Textual to detect when you assign to them, in addition to some other [*superpowers*](./guide/reactivity.md).
397+
398+
To add a reactive attribute, import [reactive][textual.reactive.reactive] and create an instance in your class scope.
399+
400+
Let's see this an action, by adding reactives to our stopwatch which we will use to calculate the elapsed time when a Stopwatch is started.
398401

399402
```python title="stopwatch05.py" hl_lines="1 5 12-27 45"
400403
--8<-- "docs/examples/tutorial/stopwatch05.py"

0 commit comments

Comments
 (0)