Components

Confirmation Button

Confirmation Button component with multiple variants and sizes.

Client Only

Installation

pnpm dlx @docyrus/cli add @docyrus/ui-confirmation-button
UI Primitives(1 component)
npx shadcn@latest add button

Usage

import {
  ConfirmationButton
} from "@docyrus/ui/components/confirmation-button";

<ConfirmationButton
  onConfirm={() => {}}
  confirmationTitle={Are you sure?}
  confirmationMessage={Please confirm before this action is executed.}
  confirmLabel="Confirm"
  cancelLabel="Cancel"
  countdownSeconds={DEFAULT_COUNTDOWN_SECONDS}
  onCancel={() => {}}
  onTimeout={() => {}}
  triggerClassName="..."
  contentClassName="..."
  side="top"
  sideOffset={0}
  contentWidth={320}
  triggerSize={0}
  triggerWidth={0}
  triggerHeight={0}
  triggerRadius={0}
  speed={0}
  bgClassName="..."
  buttonVariant="destructive"
  buttonSize="default"
/>

API Reference

PropTypeDefault
onConfirm() => void | Promise<void>—
confirmationTitleReactNode'Are you sure?'
confirmationMessageReactNode'Please confirm before this action is executed.'
confirmLabelstring'Confirm'
cancelLabelstring'Cancel'
countdownSecondsnumberDEFAULT_COUNTDOWN_SECONDS
disabledbooleanfalse
onCancel() => void—
onTimeout() => void—
triggerClassNamestring—
contentClassNamestring—
side'top' | 'bottom''top'
sideOffsetnumber—
contentWidthnumber320
triggerSizenumber—
triggerWidthnumber—
triggerHeightnumber—
triggerRadiusnumber—
speednumber—
bgClassNamestring—
buttonVariantButtonVariant'destructive'
buttonSizeButtonSize'default'
classNamestring—

On this page