flowglad-pricing-ui
Build pricing pages, pricing cards, and plan displays with Flowglad. Use this skill when creating pricing tables, displaying subscription options, or building plan comparison interfaces.
Install
mkdir -p .claude/skills/flowglad-pricing-ui && curl -L -o skill.zip "https://mcp.directory/api/skills/download/3795" && unzip -o skill.zip -d .claude/skills/flowglad-pricing-ui && rm skill.zipInstalls to .claude/skills/flowglad-pricing-ui
About this skill
Flowglad Pricing UI
Abstract
Comprehensive guide for building pricing pages, pricing cards, and plan displays with Flowglad. Covers loading states, accessing pricing data through helper functions, formatting prices correctly, highlighting current subscriptions, implementing billing interval toggles, and responsive layout patterns.
Table of Contents
- Loading States — CRITICAL
- Accessing Pricing Data — HIGH
- Building Pricing Cards — MEDIUM
- Current Plan Highlighting — MEDIUM
- Billing Interval Toggle — MEDIUM
- Responsive Layout — LOW
1. Loading States
Impact: CRITICAL
The pricing model loads asynchronously. Rendering before data is available causes visual flicker, incorrect UI states, or hydration mismatches.
1.1 Wait for pricingModel Before Rendering
Impact: CRITICAL (prevents flash of incorrect content)
Always check that billing data has loaded before rendering pricing UI. The pricingModel is null or undefined until the billing data loads.
Incorrect: renders empty or broken UI while loading
function PricingPage() {
const billing = useBilling()
// BUG: pricingModel is undefined while loading!
// This renders empty pricing grid, then re-renders when data arrives
const products = billing.pricingModel?.products ?? []
return (
<div className="pricing-grid">
{products.map((product) => (
<PricingCard key={product.id} product={product} />
))}
</div>
)
}
Users see an empty pricing page that suddenly fills in, causing layout shift and poor UX.
Correct: show loading state until data is ready
function PricingPage() {
const billing = useBilling()
// Wait for billing to load
if (!billing.loaded) {
return <PricingPageSkeleton />
}
// Handle error state
if (billing.errors) {
return <div>Unable to load pricing. Please try again.</div>
}
// Now safe to access pricingModel
const products = billing.pricingModel?.products ?? []
return (
<div className="pricing-grid">
{products.map((product) => (
<PricingCard key={product.id} product={product} />
))}
</div>
)
}
Alternative: early return pattern
function PricingPage() {
const billing = useBilling()
if (!billing.loaded || billing.errors || !billing.pricingModel) {
return <PricingPageSkeleton />
}
// TypeScript now knows pricingModel is defined
const { products } = billing.pricingModel
return (
<div className="pricing-grid">
{products.map((product) => (
<PricingCard key={product.id} product={product} />
))}
</div>
)
}
1.2 Public Pricing Pages with usePricingModel
Impact: CRITICAL (enables unauthenticated pricing pages)
For public pricing pages that don't require authentication, use the usePricingModel() hook instead of useBilling(). This returns only the pricing data without requiring a logged-in user.
Incorrect: uses useBilling for public page
// Public pricing page - no user logged in
function PublicPricingPage() {
// BUG: useBilling requires authentication context
// Will fail or return empty data for unauthenticated users
const billing = useBilling()
if (!billing.loaded) return <div>Loading...</div>
return <PricingDisplay products={billing.pricingModel?.products} />
}
Correct: uses usePricingModel for public pages
import { usePricingModel } from '@flowglad/nextjs'
function PublicPricingPage() {
// Works without authentication
const pricingModel = usePricingModel()
// Returns null while loading
if (!pricingModel) {
return <PricingPageSkeleton />
}
return (
<div className="pricing-grid">
{pricingModel.products.map((product) => {
const defaultPrice = product.defaultPrice ?? product.prices?.[0]
return (
<article key={product.slug}>
<h3>{product.name}</h3>
<p>{product.description}</p>
{defaultPrice && (
<p>
${(defaultPrice.unitPrice / 100).toFixed(2)}
{defaultPrice.intervalUnit && `/${defaultPrice.intervalUnit}`}
</p>
)}
</article>
)
})}
</div>
)
}
When to use each hook:
useBilling()- Authenticated pages where you need subscription status, checkout, or user-specific datausePricingModel()- Public pricing pages, marketing sites, or anywhere you just need to display plans
2. Accessing Pricing Data
Impact: HIGH
Flowglad provides helper functions to access products and prices by slug. Using these helpers is more reliable than manual array lookups.
2.1 Use getProduct and getPrice Helpers
Impact: HIGH (prevents runtime errors, cleaner code)
The billing object provides getProduct() and getPrice() helper functions that look up items by slug. Use these instead of manually searching arrays.
Incorrect: manual array lookup
function UpgradeButton({ targetPriceSlug }: { targetPriceSlug: string }) {
const billing = useBilling()
if (!billing.loaded) return null
// Fragile: searches across all products, easy to get wrong
const targetPrice = billing.pricingModel?.products
.flatMap((p) => p.prices)
.find((price) => price.slug === targetPriceSlug)
if (!targetPrice) return null
return <button>Upgrade to {targetPrice.name}</button>
}
Correct: use getPrice helper
function UpgradeButton({ targetPriceSlug }: { targetPriceSlug: string }) {
const billing = useBilling()
if (!billing.loaded) return null
// Clean: helper does the lookup efficiently
const targetPrice = billing.getPrice(targetPriceSlug)
if (!targetPrice) return null
return <button>Upgrade to {targetPrice.name}</button>
}
Same pattern for products:
function ProductFeatures({ productSlug }: { productSlug: string }) {
const billing = useBilling()
if (!billing.loaded) return null
// Use getProduct helper
const product = billing.getProduct(productSlug)
if (!product) return null
return (
<ul>
{product.features.map((feature) => (
<li key={feature.id}>{feature.name}</li>
))}
</ul>
)
}
2.2 Filter Products for Display
Impact: HIGH (shows only relevant products)
Not all products should appear on pricing pages. Filter out default/free products and products without active prices.
Incorrect: displays all products including internal ones
function PricingGrid() {
const billing = useBilling()
if (!billing.loaded || !billing.pricingModel) return null
// BUG: Shows ALL products, including free tier and inactive products
return (
<div>
{billing.pricingModel.products.map((product) => (
<PricingCard key={product.id} product={product} />
))}
</div>
)
}
Correct: filter to displayable products
function PricingGrid() {
const billing = useBilling()
if (!billing.loaded || !billing.pricingModel) return null
// Filter products for display
const displayProducts = billing.pricingModel.products.filter((product) => {
// Skip default/free tier products
if (product.default === true) return false
// Only show products with active subscription prices
const hasActivePrice = product.prices.some(
(price) => price.type === 'subscription' && price.active === true
)
return hasActivePrice
})
return (
<div>
{displayProducts.map((product) => (
<PricingCard key={product.id} product={product} />
))}
</div>
)
}
Transform to UI-friendly format:
interface PricingPlan {
name: string
description?: string
displayPrice: string
slug: string
features: string[]
unitPrice: number
}
function transformProductsToPricingPlans(
pricingModel: PricingModel | null | undefined
): PricingPlan[] {
if (!pricingModel?.products) return []
return pricingModel.products
.filter((product) => {
if (product.default === true) return false
return product.prices.some(
(p) => p.type === 'subscription' && p.active === true
)
})
.map((product) => {
const price = product.prices.find(
(p) => p.type === 'subscription' && p.active === true
)
if (!price?.slug) return null
return {
name: product.name,
description: product.description,
displayPrice: `$${(price.unitPrice / 100).toFixed(2)}`,
slug: price.slug,
features: product.features.map((f) => f.name).filter(Boolean),
unitPrice: price.unitPrice,
}
---
*Content truncated.*
More by flowglad
View all skills by flowglad →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversWebpage Timestamps extracts and consolidates creation, modification, and publication dates from web pages for accurate f
Unlock AI-ready web data with Firecrawl: scrape any website, handle dynamic content, and automate web scraping for resea
Build persistent semantic networks for enterprise & engineering data management. Enable data persistence and memory acro
Enhance software testing with Playwright MCP: Fast, reliable browser automation, an innovative alternative to Selenium s
Uno Platform — Documentation and prompts for building cross-platform .NET apps with a single codebase. Get guides, sampl
The fullstack MCP framework for developing MCP apps for ChatGPT, Claude, and building MCP servers for AI agents. Connect
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.