Paywall Component
Axiom01 provides a flexible and customizable paywall component to restrict access to premium content. This component helps you present subscription options or login prompts in a clear and engaging manner.
Live Example
HTML Structure
The paywall component typically consists of an overlay and a central card containing the message and calls to action.
<div class="paywall-overlay">
<div class="paywall-card">
<i class="fas fa-lock"></i>
<h3>Unlock Premium Content</h3>
<p>This content is exclusive to our premium subscribers. Join now to get full access!</p>
<div class="paywall-actions">
<button class="button primary">Subscribe Now</button>
<button class="button secondary">Log In</button>
</div>
<p class="small-text">Already a member? <a href="#">Restore Purchase</a></p>
</div>
</div>
Styling
The .paywall-overlay creates a fullscreen, semi-transparent background to obscure the content behind it. The .paywall-card is a central, styled container for your message and actions.
.paywall-overlay: Positions itself over the content, often with a blurred or darkened background..paywall-card: Styles the main content area of the paywall, using card-like styling.- Icons (
<i>) and text elements (<h3>,<p>) are styled for prominence. .paywall-actions: A container for grouping action buttons.
JavaScript Integration
While the paywall is primarily a visual component, you will need JavaScript to:
- Dynamically show/hide the paywall based on user authentication or subscription status.
- Handle interactions with "Subscribe Now" and "Log In" buttons, redirecting users or triggering authentication flows.
Accessibility
Ensure the paywall is accessible:
- Use appropriate ARIA roles if the paywall acts as a modal dialog.
- Ensure keyboard navigation is logical within the paywall.
- Provide clear and concise text for all elements.
Customization
Customize the appearance using Axiom01's CSS variables for colors, spacing, and typography. You can adjust the background of the overlay, the card's appearance, and the button styles to match your branding.