Skip to main content

delete-card

Removes a card by id. If the deleted card is currently open in the editor, the editor closes automatically.

Usage​

type DeleteCardPayload = {
id: CardID;
};
FieldTypeDescription
idCardIDID of the card to remove

Trigger​

api.exec("delete-card", { id: 1 });

Observe​

api.on("delete-card", ({ id }) => {
console.log("card deleted:", id);
});

Intercept​

api.intercept("delete-card", ({ id }) => {
return confirm("Delete this card?");
});

Returning false cancels the deletion.

Component handler​

<Kanban onDeleteCard={({ id }) => console.log("deleted", id)} />