<t-text>
A piece of text the reader clicks to rewrite. Its variable holds a string.
Dear
The element's text is the starting value, and also what readers see without JavaScript.
Attributes
| Attribute | Default | Description |
|---|---|---|
name | required | The variable that holds the text. |
value | text content | The starting value. |
format | How the text is displayed, for example "“%s”". See formats. | |
color | accent color | One CSS color, or two for light and dark mode. |
label | the name | The accessible name. |
previous | A variable to hold the text from before the last committed edit. |
Interaction
| Input | Effect |
|---|---|
| Click, Enter or Space | Opens a field to type new text. |
In the field, the variable updates live as you type. Enter (or clicking away)
commits the change, and Esc cancels and restores the text from before you opened it.
Unlike <t-num>, the field keeps exactly what's typed: it doesn't evaluate expressions.
Inside a <t-call>, a <t-text> is a string argument and gets quotes.