StatusToggle
A switch component paired with an activation/deactivation confirmation modal. Prevents accidental status changes by requiring an explicit confirmation step.
π StorybookPreviewβ
Live previewβ Open in Storybook
Importβ
import { StatusToggle } from "@xocialive/ui-components";
Basic usageβ
<StatusToggle checked={user.isActive} onConfirm={(newValue) => updateUserStatus(user.id, newValue)} />
Propsβ
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | β | Current toggle state |
onConfirm | (value: boolean) => void | β | Callback fired after the user confirms the modal |
disabled | boolean | false | Disables the toggle |
textOverrides | { activateTitle?: string; deactivateTitle?: string; confirmLabel?: string; cancelLabel?: string } | β | Custom modal copy |
sx | SxProps<Theme> | β | Root element style overrides |