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;
};
| Field | Type | Description |
|---|---|---|
id | CardID | ID 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)} />
Related
- Cards guide — card actions overview
- add-card — create a new card
- ContextMenu — built-in delete option in the right-click menu