Componentticket-stub0.84 KB gzipZero dependencies
Coupon
Discount coupon with scissor cutout lines and promo code copy.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add couponOr install the full npm package:
npm install bigbulluiUsage
tsx8 lines
import { Coupon } from "@/components/ui/coupon"; <Coupon code="BIGBULL25" discount="25%" title="FESTIVAL PASS" expires="31 DEC"/>Source code
coupon.tsx + 2 helpersZero third-party dependencies (3 local files shown in tabs below).
tsxcoupon.tsx90 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils";import { useCopy } from "./lib/hooks"; export interface CouponProps extends React.HTMLAttributes<HTMLDivElement> { code: string; discount: string; title: string; subtitle?: string; expires?: string; onApply?: (code: string) => void; className?: string;} export function Coupon({ code,Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { Coupon } from "@/components/ui/coupon"; <Coupon />| Prop | Type | Description |
|---|---|---|
| code | string | Configures code. |
| discount | string | Configures discount. |
| title | string | Primary heading or title text. |
| subtitle | string | Supporting secondary heading text. |
| expires | string | Configures expires. |
| onApply | (code: string) => void | Callback invoked on apply. |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |