Skip to content
Alea0.1

Overlays

Popconfirm

A small confirm next to the button that asks, for quick actions.

Ant Design: Popconfirm

import { Popconfirm } from '@alea/ui';

Examples

Popconfirm

Asks next to the button.

Not only for deletes

A neutral confirmation for something reversible but noticeable.

Props

Popconfirm props

A small confirm next to its trigger, for quick, reversible-ish actions (Ant's Popconfirm).

PropTypeDefaultDescription
childrenrequiredReactNode-The button that asks.
onConfirmrequired() => unknown-Called when the person confirms.
titlerequiredReactNode-The question.
cancelLabelReactNode'Cancel'Default "Cancel".
confirmLabelReactNode'Yes'Default "Confirm".
descriptionReactNode-More context under the question.
placement"start" | "end" | "bottom" | "top" | "bottom left" | "bottom right" | "bottom start" | "bottom end" | "top left" | "top right" | "top start" | "top end" | "l…'top'Where it opens relative to its trigger.
tone"danger" | "default"'default'danger turns the confirm button red.

Accessibility

  • An alertdialog in a popover; the confirm button gets focus.

Keyboard

KeyDoes
Enter or SpaceOpens it
TabMoves between Cancel and Confirm
EscapeCloses it and returns focus

Do and don't

Do

  • Ask a direct question: Remove this swatch?

Don't

  • Don't use for actions that can't be undone: use AlertDialog.
Tested with axe, keyboard and screen reader roles