Gravity
  • Welcome to Gravity
  • Getting Started
  • Stack
  • Updates
  • Rules For AI
  • Troubleshooting
  • Gravity Server
    • Introduction
    • Installation
      • Install Node.js
      • Database Setup
      • Stripe Setup
      • Mailgun Setup
      • Install Gravity
    • Application Structure
    • REST API
      • API Scopes
      • Webhooks
    • Authentication
      • Email Verification
      • Social Sign On
      • Two-Factor Authentication
    • Authorization
      • Feature Access and Plan Restrictions
      • Permissions (Roles)
    • Config
    • Environment Variables
    • Database Queries
    • Handling Errors
    • Logging
    • Localization
    • Push Notifications
    • Email Notifications
    • User Feedback
    • User Onboarding
    • File Uploads
    • Billing
      • Seat Billing
      • Usage Billing
    • Free Accounts
    • CLI Toolbelt
    • Testing
    • AI Tools
    • Background Jobs
    • Deployment
  • Gravity Web
    • Introduction
    • Tailwind & SCSS
    • Routing
    • Events
    • Authentication
    • Localization
    • Hooks
      • useAPI
      • usePlans
      • usePermissions
    • Components
      • Alert
      • Animate
      • Avatar
      • Badge
      • Breadcrumb
      • Button
      • Calendar
      • Card
      • Chart
      • Checklist
      • Credit Card
      • Detail
      • Dialog
      • Dropdown
      • Feedback
      • Form
      • Grid
      • Header
      • Helper
      • Icon
      • Image
      • Layout
      • Link
      • List
      • Loader
      • Logo
      • Nav
      • Onboarding
      • Pagination
      • Popover
      • Progress
      • Row
      • Search
      • Separator
      • Sheet
      • Social
      • Stat
      • Table
      • Tabs
      • Toast (Notification)
      • Tooltip
      • User
      • View
    • Views
    • Handling Errors
    • Deployment
  • Gravity Native
    • Introduction
    • Prerequisites
    • Installation
    • App Context
    • Authentication
    • Localisation
    • External Linking
    • Handling Errors
    • Navigation
    • Config
    • Events
    • Views
    • Components
      • Badge
      • Blankslate
      • Button
      • Card
      • Chart
      • Form
      • Global
      • Grid
      • Icon
      • List
      • Logo
      • Message
      • Modal
      • Nav
      • Notification
      • Progress Bar
      • Search
      • Separator
      • Social
      • Stat
      • View
    • Push Notifications
    • Payments
    • Building Your App
  • Mission Control
    • Introduction
    • Installation
    • User Management
    • Feedback
    • Events
    • Logs
  • Website Template
    • Introduction
    • Environment Variables
    • Styling
    • Components
      • Article
      • Feature List
      • Footer
      • Hero
      • Layout
      • Pricing
      • Meta Data
      • Nav
      • Testimonial
    • Build and Deploy
Powered by GitBook
On this page
  • Preview
  • Code
  • Config
  • Period Selector
  • Purchasing Power Parity Banner
  • Currency Selector

Was this helpful?

  1. Website Template
  2. Components

Pricing

PreviousLayoutNextMeta Data

Last updated 1 year ago

Was this helpful?

The <PricePlans> component renders a pricing table similar to that featured on the using your Stripe plans from

The styling is optimised for three plans, with one plan highlighted in the middle. You may need to adjust the styling if you want to add more than 3 plans.

Preview

Code

<PricePlans plans={ plans }/>

Config

const config = {

  period_selector: true, // show monthly/yearly switch 
  ppp_banner: false, // show a ppp banner
  currency_selector: true, // show currency selector

}

Period Selector

Show a toggle switch to choose between monthly or yearly pricing by enabling period_selector inside the config object in <PricePlans/>

Depending on the interval key value (month or year), this will show or hide plans from your config.

Purchasing Power Parity Banner

If you offer purchasing power parity pricing, you can display a banner message with the coupon code inside the component by enabling ppp_banner in the config. The text inside the banner can be customised inside <PricePlans/>

<Banner text='🇹🇭 We support purchasing power parity for citizens of Thailand. Use coupon THAI50 at checkout'/>

Currency Selector

To switch between different currencies, enable the currency_selector in config.

This will render a currency selector with a list of currencies based on your Stripe plans. By default, flags for USD, GBP, EUR and CAD are enabled, but you can import more flags into the component to support more currencies.

import { US, GB, EU, CA } from 'country-flag-icons/react/3x2' // add your flag import here

export function CurrencySelector(props){

  // add your currency flag pair here
  const flags = { usd: US, gbp: GB, eur: EU, cad: CA }

});

To list your features for each plan, modify the array of sample features added to your file during the setup process.

config
Gravity pricing page
/config.