Skip to main content

StatusToggle

A switch component paired with an activation/deactivation confirmation modal. Prevents accidental status changes by requiring an explicit confirmation step.

πŸ“– Storybook

Preview​

Import​

import { StatusToggle } from "@xocialive/ui-components";

Basic usage​

<StatusToggle checked={user.isActive} onConfirm={(newValue) => updateUserStatus(user.id, newValue)} />

Props​

PropTypeDefaultDescription
checkedbooleanβ€”Current toggle state
onConfirm(value: boolean) => voidβ€”Callback fired after the user confirms the modal
disabledbooleanfalseDisables the toggle
textOverrides{ activateTitle?: string; deactivateTitle?: string; confirmLabel?: string; cancelLabel?: string }β€”Custom modal copy
sxSxProps<Theme>β€”Root element style overrides