StealThis .dev

Empty States — No-access / permission-required state

A polished permission-required empty state for pages a member can't open yet. It pairs a lock illustration with a clear headline, a plain-language explanation, and a requester-to-owner approval chain showing who must approve. A primary Request access button opens a confirm dialog and fires a Request sent toast, while a secondary Switch account action lets people retry under a different identity. A segmented switcher flips live between no-access, upgrade-required, and request-pending so you can preview every state.

Abrir en Lab
html css vanilla-js
Targets: JS HTML

Código

No-access / permission-required state

A focused screen for the moment a member lands on a page they can’t open. A soft lock illustration, a direct headline (“You don’t have access to this page”), and a short explanation set expectations, while an approval chain shows the requester’s avatar pointing to the workspace owner who has to approve. A primary Request access button and a secondary Switch account action give the user two clear ways forward.

The demo ships three variants behind a segmented switcher: no-access (request access from the owner), upgrade-required (a Pro/Business feature gated by plan), and request-pending (the request is in flight, primary button disabled). Selecting a variant re-renders the illustration, badge tone, copy, and hint with a subtle entrance animation, and the arrow keys move between tabs.

Interactions are vanilla JS. Request access opens an aria-modal confirm dialog; confirming closes it, shows a Request sent toast, and transitions the page into the pending state for a coherent flow. Switch account opens an account picker that updates both the top-bar identity and the requester in the approval chain. Both overlays trap focus, close on Esc or backdrop click, and restore focus to their trigger. The whole thing is responsive down to ~360px, with AA-contrast colors and focus-visible rings throughout.