Black Friday: 30% off Pro

Get 30% off

Updated

Inline Confirm

Preview

Customize

Color
Timeout4.0s
Medium
Start
Radius12px

Installation

npx shadcn@latest add https://uibrik.com/r/inline-confirm.json
Adds the files to components/uibrik/inline-confirm and installs @tabler/icons-react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/inline-confirm.

Usage

import { InlineConfirm } from "@/components/uibrik/inline-confirm/inline-confirm";​<InlineConfirm  label="Delete"  confirmLabel="Confirm"  cancelLabel="Cancel"  color="#dc2626"  timeout={4}  size="md"  icon  cancelSide="start"  radius={12}  onConfirm={() => {}}/>

Where to use Inline Confirm

  • Delete in lists and tables

    Splitting into Cancel and Confirm in its own footprint avoids a modal for small deletions.

    Pairs with Hold to Confirm

  • Removing members or files

    Nothing around the button moves, so the confirm appears exactly under the user's pointer.

    Pairs with Invite Members

  • Compact cards

    Card footers with no room for a dialog still get a safe confirmation step.

Props

InlineConfirm
label
Type string
"Delete"
Button text.
confirmLabel
Type string
"Confirm"
cancelLabel
Type string
"Cancel"
color
Type string
"#dc2626"
Colour of the destructive action.
timeout
Type number
4
How long an unanswered prompt waits before backing out. 0 waits forever.
size
Type "sm" | "md" | "lg"
"md"
Height, padding and text size.
icon
Type boolean
true
Show the trash icon beside the label.
cancelSide
Type "start" | "end"
"start"
Which side Cancel grows out on.
radius
Type number
12
Corner radius.
onConfirm
Type () => void
–
Called when the action is confirmed.
className
Type string
–
Classes for the wrapper.