Sections
All-AccessNewSmall boat line, write to the purser: each valid field is punched through the card ticket, and the photograph shows through the hole
Use it as the contact form of a small operator with a physical ticket culture: each field that becomes valid is punched, a correction slip covers a field that goes wrong again, and the stub is printed on send.
pnpm dlx shadcn@latest add @motionkit-pro/punchednpx shadcn@latest add @motionkit-pro/punchedyarn dlx shadcn@latest add @motionkit-pro/punchedbunx --bun shadcn@latest add @motionkit-pro/punchedRequires an All-Access or Signature license and the @motionkit-pro registry with your token. See Installation.
The files land in components/sections/.
import { Punched } from "@/components/sections/punched"
export default function Page() {
return (
<Punched
image="/contact/harbour.webp"
content={{
brand: "Harbour Line",
title: "Write to the office.",
contact: {
office: "Front desk",
address: "Pier 1, Harbour Road",
phone: "+1 555 0100",
email: "desk@example.com",
hours: "Open until 19:00",
},
}}
onSubmit={async (values) => {
const { reference } = await send(values)
return reference
}}
/>
)
}A string onSubmit resolves with is the reference printed on the stub; a rejection shows the failure line and
keeps the card. minMessage sets the shortest accepted message (default 20).
ticket (default): the full card with four coupons. Preview it with ?demo=default.strip: the coupons in one row along a long strip ticket. Preview it with ?demo=strip.stub: a short stub with email and message only. Preview it with ?demo=stub.The demo images stay on this site and are not installed: pass your own through the props below.
| Prop | Type | Ratio | Transparent | Max weight | Notes |
|---|---|---|---|---|---|
image | string | any, landscape works best | no | 400 KB | Seen through the punched holes and around the card; optional. |
A photograph with a busy, mid-tone top and bottom reads best through the holes; imagePosition sets
the CSS object-position. Without an image the table is a flat ground mixed from print and
shadow. Use WebP or JPEG; host the files on your own origin or send CORS headers.
Every text, button names included, lives in one typed content prop; keys you leave out keep the demo copy shown above.
<Punched image={IMAGE} content={{ title: "Your title" }} />| Key | Type | Notes |
|---|---|---|
brand, brandLine, serial | string | Head of the card. |
title, lede | ReactNode | lede is hidden in stub. |
contact, contactLabel | { office, address, phone, phoneHref?, email?, hours }, string | The counterfoil. |
labels | Partial<Record<"name" | "email" | "subject" | "message", string>> | Printed under each rule; missing keys keep the default. |
subjects | { value, label, note? }[] | The boxes of the subject coupon. |
placeholder | string | Hint on the empty message lines. |
messages | PunchedMessages | Errors, counters, submit, pending, failure and stub lines; missing keys keep the default. |
stampText | string | Around the validator ring. |
reference | string | Printed on the stub when onSubmit resolves without a string. |
Prop
Type
Every colour is a prop and takes any CSS colour: hex, RGB, HSL or OKLCH.
<Punched
image={IMAGE}
colors={{
card: "#d9effd",
ink: "#281910",
print: "#7b1c00",
onPrint: "#ddf2ff",
overprint: "#008263",
crayon: "#b03100",
slip: "#e1f7ff",
stamp: "#6b3d00",
shadow: "#003330",
}}
/>use-prefers-reduced-motion, fx-runtime.stack: columns stack, text first. Vertical scroll is never blocked.
The card lies still on the photograph; a valid field shows its hole at once and the chad lies beside the card, without the dip or the fall.
pnpm size).Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Not measured yet · budget 16.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom.
—
The card lies still on the photograph; a valid field shows its hole at once and the chad lies beside the card, without the dip or the fall.
No keyboard interaction of its own.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)