Skip to content
ArcadiaDesign
Scout

Ship the release tonight, or wait for review?

Otherwise Scout waits for review and ships at 18:00.

Asked of you: choices of equal weight, none the default, Other for your words, and the otherwise line. A waiting ask looks the same.

TSX

An ask is the one way an agent interrupts a person: a message that puts one thing to one person and cannot go on without their answer. Its question is the message's own words, so the part draws what follows them, under the words in the same bubble. It takes the ask as data and gives the answer back through onAnswer; it knows no product and sends nothing itself.

The same part stands in a list: Home's Needs you puts it in a row's choices, so a row and the message say the same words in every state (see the Notifications page).

Examples

Asked of someone else

Anyone else reads the choices as plain words that cannot be pressed, and who the ask is for.

Scout

Ship the release tonight, or wait for review?

  • Ship tonight
  • Wait for review

Asked of Ada Lovelace

Otherwise Scout waits for review and ships at 18:00.

Words, not choices

An ask with no choices shows only the field. Enter sends what is typed.

Scout

What should the release notes open with?

Otherwise Scout opens them with the upload retries.

A press keeps its button busy while the answer is on its way (onAnswer returns a promise), and the ask takes no second answer meanwhile. If it does not land, error says so under the choices, and what was typed stays.

Answered

The answer takes the choices' place, with who gave it and when, for everyone who can see the ask.

Scout

Ship the release tonight, or wait for review?

Ship tonight Ada Lovelace, 2:02 PM

Withdrawn

The asker no longer needs it: the choices go, and one quiet word stays.

Scout

Ship the release tonight, or wait for review?

Withdrawn

Went on

The asker took the otherwise: the choices go, and the otherwise line says what it went on to do.

Scout

Ship the release tonight, or wait for review?

Went on Scout waits for review and ships at 18:00.

Each choice is a button named by its words, one Tab stop each, after the question in reading order. Other reports aria-expanded and gives its field the focus; Escape closes the field and puts the focus back on Other. The field is named "Your answer", and its button sends. A busy choice keeps its focus. When the choices go because the ask was answered, withdrawn or gone on from while one of them had the focus, the focus moves to the line that took their place. An error is announced. For anyone else the choices are a plain list.

EnterSpace
Presses a choice, or opens the field from Other
Enter
Sends the words in the field
Esc
Closes the field opened from Other

Ask

choices
readonly string[]Default []
The answers it offers, in the asker's order, of equal weight. None: the field alone.
other
booleanDefault false
"Other" after the choices opens one field for the person's own words. An ask with no choices always has the field.
otherwise
string
What the asker does if nobody answers, in the asker's words: the line after "Otherwise". Every ask has one; leave it out only where the host already shows it (a list row's sub).
askedOfrequired
ReactNode
The person it is put to: their name.
you
booleanDefault false
The reader is that person: the choices press and the field takes words. Anyone else reads the choices as plain words, and "Asked of" names the person.
state
"open" | "waiting" | "answered" | "withdrawn" | "gone-on"Default "open"
answer
{ readonly text: string; readonly at: ReactNode }
With answered: what the person gave, and when, in the kit's clock (fmtTime, fmtDayTime).
onAnswer
(reply: AskReply) => void | Promise<unknown>
A choice pressed or words sent. A promise keeps the pressed button busy until it settles.
error
ReactNode
The answer did not land: what happened and what to do, under the choices (announced).
rootStyle
RootStyle
Typed StyleX override: where the ask sits.

Rest props go to <div> props.