MoviePass Button

Get this button for GPUI

A cinema ticket button that tears along its perforation on click, hinging open or snapping apart.

Preview

Props

Install

npx shadcn@latest add @evilbuttons/movie-pass

Usage

import MoviePassButton from "@/components/evil-buttons/movie-pass";

export function ButtonDemo() {
  return (
    <MoviePassButton variant="snap" onTear={() => console.log("Ripped!")}>
      Admit One
    </MoviePassButton>
  );
}

Variants

Tilt

Both halves pivot on their shared bottom corners, opening a V along the tear.

Snap

The stub breaks off in a straight line and leaves a small gap.

Keep it torn

Pass resetDelay={null} to leave the ticket torn until it is clicked again, and swap the stub content with stub.

Props

The component spreads native button props.

PropTypeDefaultDescription
childrenReact.ReactNode-Label printed on the main part of the ticket.
variant"tilt" | "snap""tilt"How the ticket tears on click.
stubReact.ReactNodeNO. 01Content of the tear-off stub.
resetDelaynumber | null1800Milliseconds before the ticket mends. null keeps it torn until the next click.
onTear() => void-Fired each time the ticket tears.
onClickReact.MouseEventHandler-Native click handler. Call preventDefault() to skip the tear.
classNamestring-Extra classes passed to the button.

Good to know

  • Notches are a CSS mask, so it works on any background.

Search docs

Jump to a button documentation page