Cancellation Flow
A cancellation flow: a static original-booking summary, a real native radio list of cancellation reasons (with a conditional notes textarea for "Other"), a live refund breakdown computed from a fixed refund-percentage policy keyed by reason, and a confirmation checkbox that must be checked to enable the destructive Cancel booking button.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/cancellation-flow.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/booking/booking23.tsx instead.
Usage
The file also exports booking23Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Booking23, booking23Demo } from "@/components/blocks/booking/booking23"; export default function Page() { return <Booking23 {...booking23Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Cancel booking" | Section heading. |
| booking | BookingSummary | none | The original booking's service, date, time, and price. |
| reasons | CancellationReason[] | none | Cancellation reasons shown as a radio list. |
| className | string | none | Extra classes for the outer section element. |
Types
interface BookingSummary { service: string; date: string; time: string; price: number; } type CancellationReasonId = | "change-of-plans" | "better-price" | "emergency" | "provider-unavailable" | "day-of" | "other"; interface CancellationReason { id: CancellationReasonId; label: string; }
Behavior notes
- The reason picker is a real native radio group with client state; choosing "Other" conditionally reveals a real Textarea for notes.
- The refund breakdown is a real derived calculation: each reason id maps to a fixed refund percentage (100% for emergency/provider-unavailable, 50% for change-of-plans/better-price/other, 0% for a day-of cancellation), and the shown refund amount recomputes from the booking price whenever the selected reason changes.
- The confirmation checkbox is real client state, and the destructive Cancel booking button stays disabled until it's checked.
- The original booking summary panel is static display only, and clicking Cancel booking does not actually cancel anything or navigate anywhere.
More Booking Blocks
View all →date-time-picker
Date & Time Picker
Split-panel scheduler: a real monthly calendar on the left, morning/afternoon time slots on the right, and a live booking summary footer.
reservation-summary
Reservation Summary
A static booking confirmation card with service, date/time, provider avatar, price breakdown, promo code field, and cancellation policy.
appointment-list
Appointment List
Upcoming and past appointments grouped by date, with provider avatar, status badge, and reschedule/cancel actions.
service-selector
Service Selector
Category-tabbed grid of bookable services with icon, description, duration, and price.
provider-picker
Provider Picker
A selectable grid of staff/provider cards with rating, reviews, availability, and an Any Provider fallback.
restaurant-reservation
Restaurant Reservation
Table reservation form with a guest stepper, date/time inputs, seating pills, and a live summary panel.