@brickslab./ui-webQuiz
Countdown timer with warn and expire states and optional auto-submit callback.
Normal (60s)
Warn state (10s)
Section mode (30s)
Props
| Prop | Type | Défaut | Requis | Description |
|---|---|---|---|---|
durationSec | number | — | ✓ | Total countdown duration in seconds. |
mode | "total" | "section" | "total" | — | Shows a «section» label when in per-section mode. |
onExpire | "submit" | "lock" | "warn" | "warn" | — | Behaviour hint when time runs out. |
onExpireAction | () => void | — | — | Callback fired when the countdown reaches 0. |
warnAtSec | number | — | — | Seconds remaining at which the warn state activates. Defaults to 20% of durationSec. |
Override rapide
Tous les paramètres listés dans cette table sont overrideables via les props. Utilisez ce squelette comme point de départ.
<MyComponent
durationSec={0}
mode="total"
onExpire="warn"
onExpireAction={...}
warnAtSec={0}
/>durationSecmodeonExpireonExpireActionwarnAtSec