Dot Crossing
Before signing someone out, it shows a pedestrian signal in LEDs: a little green man walking beside the seconds left, calm at first and quickening until he runs, the way animated signals in Taiwan hurry people across. Stay signed in and he settles back to a walk and it goes; let the count reach zero and the red man stands. It gives people the warning and the way to extend that WCAG asks for.
Needs: None. One small canvas. Your app owns the session; pass when it ends.
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| expiresAt | number | required | When the session ends, ms since the epoch. Move it later and the warning goes. |
| warnFor | number | 60 | Seconds before the end it appears. Up to 99. |
| onStay | () => void | required | Extend the session, then move expiresAt. |
| onSignOut | () => void | – | Sign out now. |
| onTimeout | () => void | – | The time ran out. |
| signInHref | string | – | Where Sign in again goes. |
| position | "bottom-right" | "bottom-left" | "inline" | "bottom-right" | Pinned to a corner, or in the page. |
| className | string | – | Class on the card. |
| style | CSSProperties | – | Style on the card. |