UIR

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-sheet

Usage

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

PropTypeDefault
triggerLabel

Label of the closed button.

string—
title

Card heading.

string—
message

Card body text.

string—
confirmLabel

Confirm button label once open.

stringtriggerLabel
cancelLabel

Cancel button label.

string"Cancel"
onConfirm

Called when the confirm button is pressed in the open card.

() => void—
onCancel

Called on Cancel, ×, or tapping the dimmed area.

() => void—
icon

Shown top-left of the card.

ReactNodealert icon
color

Button and icon colour.

string"#ff1f3d"
cardHeight

Card height when open.

number250
bottomInset

Extra space under the button, e.g. the safe-area bottom.

number0