Skip to content

InlineConfirm

Stable

A button that asks "Delete this?" in its own place, with the safe choice focused, instead of opening a dialog.

Also known as popconfirm, confirm, are you sure

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Delete a chat

  • Trip to Lisbon
  • Quarterly report
  • Gift ideas

Each row has its own control. The confirm button uses the danger colour.

When to use it

Adds one small step before an unwanted action, without taking people out of what they were doing.

Made of: First button · Question · Cancel button · Confirm button

Use it for

  • Deleting a chat, a file or an item from a list.
  • Discarding a draft or clearing a form.
  • Removing something that can be recreated, but with some effort.

Not for

  • An action that cannot be undone and has big effects, such as deleting an account: use Dialog.
  • Letting an agent act on someone's behalf: use ApprovalPrompt.
  • An action that is easy to undo, where an Undo afterwards is kinder: use Toast.

Do and avoid

Delete this chat?
Do. A small check in place of the button before deleting one chat.
Delete your account?
Avoid. Deleting a whole account needs a full dialog, not a quick tap.

Do

  • Ask a short, specific question, such as "Delete this chat?".
  • Use the danger tone when the action removes something.
  • Use a dialog instead when people need to read more before deciding.

Avoid

  • Do not use it for actions that cannot be undone and matter a lot.
  • Do not chain two inline confirms one after the other.
  • Do not set the timeout so short that people cannot read the question.

On a phone

  • All three buttons keep their size and have a 44px tap area on touch screens.
  • A finger on the control pauses the timer, and it starts again when the finger lifts.
  • The control keeps the width of its widest state, so the question does not push nearby items around. Keep the question short on a phone.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started