Components / Assistant / Ask panel

A1 · Assistant New

Ask panel

Questions over the example register. A write shows a confirm card before it changes anything.

When to use

  • Questions can be answered from a known local set.
  • A write must wait for an explicit confirm.

When not to use

  • The panel would send the text to a service.
  • There is no local data to answer from.

Usage

<form data-ask-form>
  <label>Question<input name="q"></label>
  <button type="submit">Send</button>
</form>
<div class="card" hidden>
  <p>Set the owner of DOC-1104 to M. Chen.</p>
  <button type="button">Confirm</button>
  <button type="button">Cancel</button>
</div>

Variants

The preview shows the form used in the gallery.

Props

NameTypeDefaultDescription
data-logregion—Questions and replies. aria-live=polite.
data-confirmcardhiddenShown before a write.
data-ownertextUnassignedUpdates only after Confirm.

Keyboard

KeyAction
EnterSends the question.
EnterOn Confirm or Cancel, resolves the write.
EscapeDoes not close the page. Cancel is the explicit control.

Accessibility

Motion

Pattern origin

Pattern type: a question panel over local data, with a confirm step before a write.

Related

DialogData tableSource note