Skip to main content
io.group puts several io calls on one form. The person fills them in and presses Continue once, and the handler gets all the values together.

Usage

A form with Company name, Trial ends at and Note for the team fields and a Continue button
Pass the io calls without await: an io call does nothing until it is awaited, so inside io.group it only describes its field. The fields appear in the order of the object’s keys.

Arguments

Returns

An object with the same keys, each holding the value its io call returns, typed per key. In the example above, company and note are string and endsAt is a luxon DateTime.

Built-in validation

Every field is checked on the server when the form is sent, and all errors come back at once, each shown under its own field. The handler continues only when every field is valid. An empty object (io.group({})) shows just the Continue button.

Custom validation

For a check across fields, chain .validate() to the group. The function gets the values as the handler would get them and returns a message, or nothing when they are fine. The message shows above Continue, not under one field:
A form with Discount code, Starts on and Ends on fields and the message The code must end after it starts. above the Continue button
It runs on the server, may be async, and runs only once every field passed its own checks, including the .validate() of a single field. io.group itself is part of awaitio and needs no registration; the fields inside it use the components you registered in components.