Skip to Content
Kokonut UI

BT-10Buttons

Tear Button

A confirm button you tear off like a ticket stub, hole by hole.

Install with
no extra packages

PROPay Button and more like it are in Kokonut UI Pro

Installation

Tear Button is a free, open-source React component in the Kokonut UI Buttons collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/tear-button.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/tear-button

Usage

import TearButton from "@/components/kokonutui/tear-button";

export default function Example() {
  return <TearButton />;
}

Props

tone
keyof typeof TONESDefault "default"

Paper colour.

icon
ReactNodeDefault built-in

Shown in the round chip until the stub is torn; a trash can by default.

label
stringDefault "Delete workspace"
description
stringDefault "Tear off the stub to confirm"
stubLabel
stringDefault "Tear"
confirmedLabel
stringDefault "Workspace deleted"
confirmedDescription
stringDefault "Kept in trash for 30 days"
onConfirm
() => void

Called once the stub comes away.

resetAfter
numberDefault 2400

Print a fresh stub this many ms after confirming. Off when 0.

className
string

Extra classes for the root element.

Dependencies

NeedsVersionComes from
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.