AddThisFeature

Age Verification Gate

Ask visitors to confirm their age before restricted content, and remember the answer.

simple Privacy & Compliance

What it adds

An interstitial on age-restricted pages that records a confirmation and does not ask again on every visit.

What your agent is told to do

5
  1. 1

    Apply the gate only to the pages that genuinely need it. Gating an entire site, including its help and legal pages, drives away visitors who were never going to see the restricted content.

  2. 2

    Store the decision the same way the app already stores Consent and Cookie Preferences, and put the age confirmation in that same preference record rather than inventing a second cookie with its own expiry rules.

  3. 3

    Give a refusal a real destination: an explanation page, or the site the visitor most likely came from. A blank screen or an infinite redirect loop reads as a broken site, not a policy.

  4. 4

    Build the gate on the app's existing Accessible Modal and Drawer Behaviour or Focus Containment Primitive so focus is trapped, Escape has a defined meaning, and the whole thing is reachable by keyboard.

  5. 5

    Do not treat this as identity verification. A self-declared checkbox is a legal formality, and building a date-of-birth capture or an ID upload on the back of it creates a data protection obligation nobody asked for.

Edge cases it handles

8
  • Remember the decision so a returning visitor is not gated on every page load, but do not let the gate hide the page from search engine crawlers and link previews. Serve the underlying content to crawlers and gate the rendered experience.
  • A visitor who declines needs somewhere to go. Send them to a page that explains why, and make sure that page is not itself behind the gate.
  • The minimum age differs by jurisdiction. Derive it from the visitor's region where the app already knows it, default to the strictest applicable age when it does not, and let the value be configured rather than hardcoded.
  • The gate must be fully operable from the keyboard, with focus moved into it on open, contained while it is open, and returned to a sensible place on close. A mouse-only gate blocks the page for anyone who cannot use one.
  • Do not collect a date of birth when a confirmation is enough. If a birth date genuinely is required, store the derived answer and discard the date rather than keeping a piece of personal data you have no use for.
  • The gate must not flash the restricted content before it appears. Decide server-side or before first paint, not after the page has rendered.
  • Deep links from social media and search results land directly on restricted pages. The gate must handle that entry point and return the visitor to the page they asked for after confirming.
  • The stored decision must be resettable, and clearing site data must clear it. Persisting a confirmation the visitor cannot revoke is not defensible.

Definition of done

9
  • Only age-restricted pages are gated; the rest of the site is reachable.
  • A confirmed visitor is not asked again within the retention period, and the decision lives alongside the app's other consent preferences.
  • Declining leads to a real explanatory destination with no redirect loop.
  • The minimum age is configurable and varies by visitor region, defaulting to the strictest applicable value.
  • The gate traps focus, is fully keyboard operable, and restores focus on close.
  • Restricted content is never visible before the gate resolves.
  • No date of birth is stored when a confirmation would do, and the decision can be cleared by the visitor.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.