Valyro English version

Tear-off Ticket

Билет с корешком, который отрывается по перфорации. Бесплатно, MIT · Интерактивные блоки › Наклейки, билеты и табло

Установка

npx valyro-cli@latest add tear-off-ticket
npx shadcn@latest add https://valyro.xyz/r/tear-off-ticket.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { TearOffTicket } from 'valyro-ui';

Пропсы

PropTypeDefault
front *ReactNodeThe visible face of the closed ticket.
revealedContent *ReactNodeWhat tearing the stub off reveals: a code, an invitation, event details. Not a secret: it is in the page.
stubReactNodeContent of the stub; default labels.stub.
openbooleanControlled open; use with onOpenChange.
defaultOpenbooleanfalseInitial open when uncontrolled.
onOpenChange(open: boolean, reason: TearOffTicketReason) => voidA request to change the state, with what caused it. Controlled tickets open once open turns true.
onReveal() => voidOnce per real opening (the accepted open going from false to true); not for a ticket that starts open.
tearThresholdnumber0.65Share of the stub's size it must be pulled before release tears it off (a quick flick needs less). Default 0.65.
orientation'horizontal' | 'vertical''vertical'Direction of the perforation: vertical (default, the stub at the inline end, pulled sideways) or horizontal (the stub at the bottom, pulled down).
variant'plain' | 'paper' | 'game''plain'Look: plain (default) quiet surfaces and a thin dashed line, paper printed card with notches, game a pass in the theme's accent.
labelsPartial<TearOffTicketLabels>Overrides for the built-in English text; keys left out keep their defaults.

Похожие компоненты

  • Peel Sticker — Наклейка отклеивается за угол и открывает содержимое
  • Scratch Reveal — Стираемое покрытие над текстом или картинкой
  • Split-Flap Board — Механическое табло: перелистываются только изменившиеся символы
  • Swipe Action Card — Горизонтальный свайп открывает действия карточки
  • Feature Hotspots — Точки на изображении: нажатие открывает пояснение к детали
  • Exploded Layers — Подготовленные слои изображения раздвигаются с подписями
  • Prediction Card — Сначала предположение читателя, затем ответ и разбор
  • Detail Dial — Выбор глубины объяснения: кратко, подробно, полный разбор
  • Version Scrubber — Просмотр подготовленных версий одним ползунком
  • Page Minimap — Мини-карта длинной страницы с видимой областью
  • Sticker Board — Свободная композиция из фотографий, наклеек и заметок: двигать и поворачивать
  • Lasso Select — Выделение группы карточек рамкой

Назад: Scratch Reveal · Далее: Split-Flap Board · Весь раздел «Интерактивные блоки»