Valyro English version

Prediction Card

Сначала предположение читателя, затем ответ и разбор. Бесплатно, MIT · Интерактивные блоки › Интерактивные объяснения

Установка

npx valyro-cli@latest add prediction-card
npx shadcn@latest add https://valyro.xyz/r/prediction-card.json
npm install valyro-ui

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

Пропсы

PropTypeDefault
questionId *stringId of the question: a new id resets the attempt.
question *ChoiceQuestion | NumericQuestionThe question: one choice among options, or a number.
answer *ChoiceAnswer | NumericAnswerThe prepared answer, of the same kind as the question. It is in the page data, so this is not a secure exam.
explanation *ReactNodeThe explanation shown after the reveal.
detailsReactNodeA longer breakdown, folded under the explanation.
tolerancenumber0Numeric questions: how far a guess may be to count as close, in the question's unit. Default 0.
allowRetrybooleantrueShows "Try again" after the reveal. Default true.
onReveal(result: PredictionResult) => voidCalled once per reveal with the guess and how it compares.
source{ label: string; href: string }A link to the source of the explanation.
headingLevel2 | 3 | 4 | 5 | 63Level of the question heading. Default 3.
labelsPartial<PredictionCardLabels>Overrides for the built-in English text; keys left out keep their defaults.

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

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

Назад: Exploded Layers · Далее: Detail Dial · Весь раздел «Интерактивные блоки»