ConfirmSheet
A full-width button grows into a confirmation card. It shrinks to half width to become the confirm button, Cancel appears beside it, and the screen dims.
Preview
Installation
npx @codewithrabby/ui@latest add confirm-sheetUsage
import { ConfirmSheet } from "@/components/uir/confirm-sheet";
<View style={{ flex: 1 }}>
{/* your screen content */}
<ConfirmSheet
bottomInset={insets.bottom}
triggerLabel="Remove wallet"
confirmLabel="Remove"
title="Are you sure?"
message="You could lose access forever."
onConfirm={removeWallet}
/>
</View>Props
| Prop | Type | Default |
|---|---|---|
triggerLabelLabel of the closed button. | string | — |
titleCard heading. | string | — |
messageCard body text. | string | — |
confirmLabelConfirm button label once open. | string | triggerLabel |
cancelLabelCancel button label. | string | "Cancel" |
onConfirmCalled when the confirm button is pressed in the open card. | () => void | — |
onCancelCalled on Cancel, ×, or tapping the dimmed area. | () => void | — |
iconShown top-left of the card. | ReactNode | alert icon |
colorButton and icon colour. | string | "#ff1f3d" |
cardHeightCard height when open. | number | 250 |
bottomInsetExtra space under the button, e.g. the safe-area bottom. | number | 0 |