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';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
questionId * | string | Id of the question: a new id resets the attempt. | |
question * | ChoiceQuestion | NumericQuestion | The question: one choice among options, or a number. | |
answer * | ChoiceAnswer | NumericAnswer | The prepared answer, of the same kind as the question. It is in the page data, so this is not a secure exam. | |
explanation * | ReactNode | The explanation shown after the reveal. | |
details | ReactNode | A longer breakdown, folded under the explanation. | |
tolerance | number | 0 | Numeric questions: how far a guess may be to count as close, in the question's unit. Default 0. |
allowRetry | boolean | true | Shows "Try again" after the reveal. Default true. |
onReveal | (result: PredictionResult) => void | Called once per reveal with the guess and how it compares. | |
source | { label: string; href: string } | A link to the source of the explanation. | |
headingLevel | 2 | 3 | 4 | 5 | 6 | 3 | Level of the question heading. Default 3. |
labels | Partial<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 · Весь раздел «Интерактивные блоки»