StealThis .dev

Onboarding — Welcome / first-run modal

A polished first-run welcome modal for product onboarding, built as an accessible dialog with role=dialog, aria-modal, a focus trap, and Escape or backdrop dismissal. It greets a returning user by name, pairs a gradient illustration header with two or three icon-led highlight bullets, and offers a primary Get started action alongside a low-key Skip for now link. A page button replays it, dismissal is remembered for the session, and live variant switches toggle single-screen versus a two-step carousel and an illustration versus compact header.

在 Lab 中打开
html css vanilla-js
目标: JS HTML

代码

Welcome / first-run modal

The classic first-run greeting, done properly. On load the dialog opens over a blurred workspace shell, welcomes Rosa by name, and lays out what she can do next in three icon-led highlight rows: import existing work, invite the team, and automate the busywork. A primary Get started button anchors the footer with a quieter Skip for now link beside it, and a replay button in the top bar reopens the modal at any time. Dismissal is tracked in an in-memory session flag so a real app could decide whether to show it again.

It behaves like an accessible modal should. The container is a role="dialog" with aria-modal, labelled and described by its own heading and intro copy. Focus moves to the primary action on open, a Tab focus trap keeps keyboard users inside the dialog, and Escape, the close button, the Skip link, or a backdrop click all dismiss it and restore focus to the element that opened it. A small toast() helper confirms each outcome through an aria-live region, and a prefers-reduced-motion block stills the entrance animations.

A floating switcher demonstrates the variants live. Flow swaps between a single-screen layout and a two-step carousel — the second step adds a template picker (Blank, Sprint board, Calendar) as a radiogroup with Back and Finish controls and animated progress dots — while Header toggles the gradient illustration banner against a compact header for denser surfaces. The layout collapses to a single column and a stacked control bar down to 360px.

Illustrative UI only — fictional names and data.