BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/paddle/subscription-alert

Subscription alert

paddle/subscription-alert
FreeComponent

Contextual alerts for subscription events: payment failures, scheduled cancellations, pauses, trials. Derives the correct alert from subscription state automatically.

Install it

npx shadcn@latest add https://developer.paddle.com/r/subscription-alert.json

Source

registry/new-york/blocks/subscription-alert/components/subscription-alert.tsxdeveloper.paddle.com/r/subscription-alert.json
1"use client"
2
3import * as React from "react"
4import { AlertCircle, Info, TriangleAlert, X } from "lucide-react"
5import { Alert, AlertDescription } from "@/registry/new-york/ui/alert"
6import { cn } from "@/lib/utils"
7import type { SubscriptionAlertData } from "@/registry/new-york/blocks/paddle-helpers/lib/paddle-types"
8import {
9 deriveSubscriptionAlert,
10 type AlertVariant,
11} from "@/registry/new-york/blocks/subscription-alert/lib/subscription-alert-utils"
12
13/** Props for the `SubscriptionAlert` component. */
14export type SubscriptionAlertProps = {
15 subscription?: SubscriptionAlertData
16 onDismiss?: () => void
17 className?: string
18}
19
20const VARIANT_CONFIG: Record<AlertVariant, { icon: React.ElementType; className: string }> = {
21 destructive: {
22 icon: AlertCircle,
23 className: "border-destructive/50 bg-destructive/15 text-destructive [&>svg]:text-destructive",
24 },
25 warning: {
26 icon: TriangleAlert,
27 className:
28 "border-warning/40 bg-warning/15 text-warning-foreground [&>svg]:text-warning-foreground",
29 },
30 info: {
31 icon: Info,
32 className: "border-info/40 bg-info/15 text-info-foreground [&>svg]:text-info-foreground",
33 },
34}
35
36export function SubscriptionAlert({ subscription, onDismiss, className }: SubscriptionAlertProps) {
37 const alert = deriveSubscriptionAlert(subscription)
38
39 if (!alert) return null
40
41 const config = VARIANT_CONFIG[alert.variant]
42 const Icon = config.icon
43
44 return (
45 <Alert className={cn("relative", config.className, className)}>
46 <Icon className="size-4" />
47 <AlertDescription className="flex items-center justify-between gap-4 text-inherit">
48 <span>
49 {alert.message}
50 {alert.actionUrl && alert.actionLabel && (
51 <>
52 {" "}
53 <a
54 href={alert.actionUrl}
55 target="_blank"
56 rel="noopener noreferrer"
57 className="font-medium underline underline-offset-2 hover:no-underline"
58 >
59 {alert.actionLabel}
60 </a>
61 </>
62 )}
63 </span>
64 {onDismiss && (
65 <button
66 onClick={onDismiss}
67 aria-label="Dismiss alert"
68 className="shrink-0 rounded-sm opacity-60 hover:opacity-100 transition-opacity focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
69 >
70 <X className="size-4" />
71 </button>
72 )}
73 </AlertDescription>
74// … truncated

What it pulls in

npm packages

  • lucide-react

Other registry items

  • @paddle/paddle-helpers
  • alert

Files it writes

  • registry/new-york/blocks/subscription-alert/components/subscription-alert.tsx
  • registry/new-york/blocks/subscription-alert/components/paddle-subscription-alert.tsx
  • registry/new-york/blocks/subscription-alert/lib/subscription-alert-utils.ts

Facts

Registry
paddle
Type
registry:component
Access
Free
Files written
3
Theme wiring
ships cssVars
Licence
Apache-2.0
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

developer.paddle.com PaddleHQ/paddle-ui on GitHub Raw registry item This item as JSON

More from paddle

All 14 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Billing interval togglebilling-interval-togglepaddleComponentsFreeno deps
Checkout summarycheckout-summarypaddleComponentsFreeno deps · 3 files
Plan change breakdownplan-change-breakdownpaddleComponentsFree1 dep · 3 files
Plan change previewplan-change-previewpaddleComponentsFree1 dep · 3 files
Pricing cardspricing-cardspaddleComponentsFree1 dep · 2 files
Pricing select cardspricing-select-cardspaddleComponentsFree1 dep · 4 files
Subscription payment cardsubscription-payment-cardpaddleComponentsFree1 dep · 3 files
Subscription status cardsubscription-status-cardpaddleComponentsFree1 dep · 3 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex