Skip to main content

Delete Account Button

A secure delete account component that provides user account deletion functionality with confirmation modal and proper error handling.

Getting Started

Basic Usage

The simplest way to implement account deletion:

import { DeleteAccountButton } from "@ovok/native";
import React from "react";

const BasicDeleteAccount = () => {
return <DeleteAccountButton />;
};

export default BasicDeleteAccount;

Features

  • Confirmation Modal: Built-in confirmation dialog to prevent accidental deletion
  • Secure Deletion: Integrates with backend API for proper account deletion
  • Error Handling: Comprehensive error handling with callback support
  • Theme Integration: Consistent styling with your app theme
  • Icon Integration: Uses profile delete icon with error color
  • Auto Logout: Automatically clears active login session after deletion
  • TypeScript: Full type safety throughout

Props

Extends all SettingListItemProps with additional delete-specific functionality.

PropTypeDefaultDescription
titlestring"settings.delete-account" translationCustom button title
onSuccess() => voidundefinedCalled when account deletion succeeds
onError(error: Error) => voidundefinedCalled when account deletion fails
onPress() => voidundefinedCalled when button is pressed (before modal)

Inherited Props

All props from SettingListItem are supported:

  • style - Custom styling
  • testID - Test identifier
  • disabled - Disable the button
  • subtitle - Additional description text
  • And all other SettingListItemProps

Localization

The component uses these translation keys:

{
"settings": {
"delete-account": "Delete Account",
"delete-account-confirmation": "Are you sure you want to delete your account? This action cannot be undone."
},
"common": {
"cancel": "Cancel",
"delete": "Delete"
}
}
  • Logout Button - Simple session termination without account deletion
  • Profile Form - User account management and editing
  • Sign-In - User authentication (needed after account recovery)