Directory
- Welcome
Plans Section
The Plans section component creates interactive pricing tables with monthly/yearly billing options, feature comparisons, and customizable tiers. Perfect for SaaS products, subscription services, and membership sites.
Overview
Plans section provides:
- Dynamic Pricing: Toggle between monthly and yearly billing
- Feature Comparison: Detailed feature matrix across tiers
- Automatic Discounts: Calculate and display yearly savings
- Responsive Design: Adapts to all screen sizes
- Accessible Controls: ARIA-compliant interactive elements
Basic Usage
<Plans data={{ models: ['monthly', 'yearly'], defaultModel: 'monthly', tiers: [ { id: 'free', name: 'Free', price: { monthly: 0, yearly: 0 }, features: { 'Feature 1': { value: true }, 'Feature 2': { value: false }, }, cta: { text: 'Get Started', href: '/signup', }, }, ], sections: [ { name: 'Core Features', features: ['Feature 1', 'Feature 2'], }, ], }}/>
Configuration
Pricing Tiers
interface PricingTier { id: string; name: string; price: { monthly: number; yearly: number; }; features: { [key: string]: { value: boolean | string; tooltip?: string; }; }; cta: { text: string; href: string; }; featured?: boolean;}
Feature Sections
interface Section { name: string; features: string[];}
Props API
Prop | Type | Required | Description |
---|---|---|---|
data.models | PricingModel[] | Yes | Available billing cycles (monthly/yearly) |
data.defaultModel | PricingModel | Yes | Default billing cycle |
data.tiers | PricingTier[] | Yes | Array of pricing tiers |
data.sections | Section[] | Yes | Feature comparison sections |
Features
Billing Toggle
The component includes an interactive billing toggle that:
- Switches between monthly and yearly pricing
- Calculates and displays savings percentage
- Persists selection during navigation
- Updates prices dynamically
Feature Comparison
Feature comparison table supports:
- Boolean features (checkmark/x)
- Text value features
- Feature tooltips
- Section grouping
- Responsive scrolling
Visual Customization
Customize the appearance with:
- Featured tier highlighting
- Custom CTA buttons
- Flexible layout options
- Theme-aware styling
Best Practices
-
Pricing Structure
- Keep pricing tiers clear and distinct
- Highlight recommended plans
- Show yearly savings prominently
- Use consistent feature descriptions
-
Feature Presentation
- Group related features logically
- Use tooltips for complex features
- Maintain consistent comparison points
- Highlight key differentiators
-
User Experience
- Ensure mobile responsiveness
- Maintain clear visual hierarchy
- Provide clear CTAs
- Keep feature descriptions concise
Common Applications
- SaaS pricing pages
- Membership tiers
- Service packages
- Product comparisons
- Subscription plans
- Feature matrices
Accessibility Features
- ARIA labels for interactive elements
- Keyboard navigation support
- Screen reader-friendly markup
- High contrast visual indicators
- Semantic HTML structure
Related Components
- Button - For CTA elements
- Card - For individual plan displays
- Badge - For feature highlights
- Tooltip - For feature explanations
Limited Time Launch Sale
Create professional pricing pages with our pre-built Plans component. Get the AstroJS starter template now and start selling your products effectively.
GET 60% OFF!