Available Components
| Component | Description |
|---|---|
AgeVerification | Displays an age verification modal before allowing access to the site. |
Basic Usage
Add the component near the root of your application.How It Works
The component:- Displays an age verification prompt.
- Requires the visitor to confirm they are of legal age.
- Stores the verification result locally.
- Prevents the prompt from appearing again until the verification expires.
Default Experience
The default verification flow includes:- Age confirmation prompt
- Acceptance action
- Exit action
- Local storage persistence
- Mobile-friendly design
Custom Message
Customize the messaging shown to visitors.Custom Button Labels
Redirecting Underage Visitors
You may choose to redirect visitors who do not meet age requirements.- Corporate landing pages
- Educational resources
- Regulatory information
- Alternative websites
Verification Duration
By default, verified visitors are remembered for a period of time.Example: 7 Days
Example: 90 Days
Props
| Prop | Type | Description |
|---|---|---|
title | string | Modal title. |
description | string | Verification message. |
confirmLabel | string | Confirmation button text. |
cancelLabel | string | Exit button text. |
redirectUrl | string | Optional URL used when access is denied. |
rememberDays | number | Number of days verification should persist. |
className | string | Additional CSS classes. |
Example: Lounge Website
Example: Brand Website
Styling
The age verification modal inherits Boxpressd theme variables.Custom Styling
Local Storage
The component stores verification status in local storage. Example flow:Accessibility
The component is designed to be accessible and keyboard-friendly. Features include:- Keyboard navigation
- Focus management
- Screen reader support
- Mobile responsiveness
Compliance Considerations
Age verification requirements vary by jurisdiction. The Boxpressd Sites SDK provides a user-friendly verification mechanism, but businesses remain responsible for ensuring compliance with applicable laws and regulations. Consider consulting legal counsel if your business operates across multiple jurisdictions.Common Use Cases
Entire Website
Premium Cigar Brand
Lounge Website
Best Practices
- Place the component near the root of your application.
- Keep messaging concise and clear.
- Use a reasonable verification duration.
- Match the modal styling to your brand.
- Provide a clear exit option.
- Review local regulations regularly.
Troubleshooting
Verification Appears Every Visit
Verify:- Local storage is enabled.
rememberDaysis configured correctly.- Browser privacy settings are not clearing storage.
Styling Is Not Applied
Verify:- The component is wrapped by the provider.
- Theme variables are loaded correctly.
- Custom CSS is loaded after SDK styles.
Redirect Is Not Working
Verify:- The URL is valid.
- The redirect destination is publicly accessible.
Next Steps
Continue to:- Theming
- Events
- Reviews
- Maps