io.input.text
One line of text, typed by a person.
io.input.text asks a person for one line of text and waits for the answer. The handler gets a string. Use it for a name, a code or a search term. The server checks every answer before your code goes on.
The simplest one
The whole action file, and roughly what your team sees when it runs.
Create account
What you can set
The settings you will reach for most, each with the line of code that turns it on.
A hint inside and under. placeholder shows in the empty field. helpText sits under it.
Starts filled. defaultValue opens the field with a value the person can change. Without it, the field starts empty.
Length limits. Set the fewest and the most characters. A wrong length comes back with a message under the field.
Required by default. An empty field or one with only spaces is sent back. The server checks it, so the browser cannot skip it.
Or optional. .optional() lets the field stay empty. The handler then gets string | undefined.
Your own check. .validate() runs on the server after the built-in checks. It can ask your database and return a message for the field.
Shown, not changed. A disabled field shows its starting value and cannot be edited. The handler gets that value whatever the browser sends.
A plain string. The handler gets a string, exactly as typed. Spaces around it stay.
Next to other fields. Inside io.group it is one field of a form. One Continue sends them all.
More in the docs
This page shows the idea. The docs have every prop, the checks on the server and more examples.
Next components
Three more calls on io. Each one shows a control and hands your code a typed value.
Write your first tool today.
An async function, a few await calls, and the form is in the browser.