Modus UI

Stub Pass

Web (React)

A perforated card with a primary-ink stub you can drag and tear clean off.

The body takes the card token and the stub is printed in the theme's primary, so the perforation reads as a clear seam in any palette. The card tilts toward the pointer and the stub resists before it rips.

Admit one · Evening readingThe Quiet PressHall B · 19:30
Seat14C
Modus / Stub Pass

Installation

CLI

npx @modus-ui/cli add stub-pass

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/stub-pass.tsx.
  3. Paste the code.

Usage

tsx
import { StubPass } from "@/components/ui/stub-pass";

export default function Example() {
  return (
    <StubPass stub={<span className="font-serif">14C</span>}>
      <span className="font-serif">The Quiet Press</span>
    </StubPass>
  );
}

Props

PropTypeDefaultDescription
childrenanynull-
stubanynull-
imagestring""-
imageAltstring""-
scrimbooleantrue-
imageRadiusnumber8-
orientationstring"horizontal"-
tornany--
defaultTornbooleanfalse-
onTearany--
widthnumber460-
heightnumber250-
stubSizenumber150-
radiusnumber16-
holesnumber12-
holeSizenumber6-
notchnumber3-
roughnessnumber0-
tearAnglenumber30-
stretchnumber30-
resistancenumber0.45-
rotatenumber4-
tiltbooleantrue-
tiltMaxnumber9-
tiltReachnumber260-
parallaxnumber6-
perspectivenumber1000-
backgroundstring"hsl(var(--card))"-
colorstring"hsl(var(--foreground))"-
borderbooleantrue-
borderColorstring""-
borderWidthnumber1-
stubBackgroundstring"hsl(var(--primary))"-
recenterbooleantrue-
disabledbooleanfalse-
ariaLabelstring"Tear off the stub"-

Comments

  • No comments yet.