StellarAdmin is still in development. We'd love for you to try it out and get your feedback, but please be advised that you may run into bugs. Changes to public APIs may also occur.

Destructive actions

Some actions are destructive as they can irreversibly alter resources. For such actions, you can indicate to the user that they are about to perform a dangerous action by calling the IsDestructive() method during registration.

builder.AddResource<BlogPost>(rb =>
{
    // ...

    rb.AddAction<UnpublishPost>("Unpublish",
        actionBuilder =>
        {
            // ...

            actionBuilder.IsDestructive();
        });
});

The button the user clicks will give a visual indication that the action is dangerous.

The button for a destructive action

For actions that display a dialog, the appearance of the dialog icon and confirm button will also be altered to indicate to the user that they are about to perform a dangerous action.

The dialog for a destructive action