io.display.heading

A title that splits a long form into sections.

io.display.heading shows a section title in a page or in a step of an action. It splits a long form or page into parts a person can scan. A line under the title can say what the section is for. It only displays and returns nothing.

The simplest one

The whole action file, and roughly what your team sees when it runs.

src/actions/companies/editCompanyAction.ts
import { app } from '../../app';
export const editCompanyAction = app.defineAction({
name: 'Edit company',
handler: async ({ io }) => {
const { name, billingEmail } = await io.group({
company: io.display.heading('Company', {
description: 'How the account is billed.',
}),
name: io.input.text('Name'),
billingEmail: io.input.email('Billing email'),
});
},
});
The code. One call in an action, the whole file.
tools.example.com/actions/companies/edit_company

Edit company

CompanyHow the account is billed.
Name 
Billing email 
Continue
In the browser. Roughly what your team sees. Your theme decides the details.

What you can set

The settings you will reach for most, each with the line of code that turns it on.

io.display.heading('Company')

The label is the title. The component draws the label itself. There is no second, smaller heading above it.

description: 'How it is billed.'

A line under it. Say what the section is for in one line of description under the title.

level: 3

Two sizes. Level 2, the default, is bigger than the labels of the fields under it. Level 3 matches the headings above tables.

company: io.display.heading('Company'),

Between the fields. Put headings into io.group to split one long form into sections. They answer nothing.

io.display.heading('This month')

On a page. Split a folder's page into parts, each with its own title above the tables and tiles.

display: { title: displayHeading }

Under any key. Register it under the key you want. The key is the name, so title gives io.display.title().

Write your first tool today.

An async function, a few await calls, and the form is in the browser.

AwaitIO is free for small teams, made possible by companies and people who sponsor it.