Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Integrate PricingSection component and update pricing page layout

Bill Yang5caf1867011c
diff --git a/docs/src/app/components/PricingSection.jsx b/docs/src/app/components/PricingSection.jsx
new file mode 100644
index 000000000..45461ab27
--- /dev/null
+++ b/docs/src/app/components/PricingSection.jsx
@@ -0,0 +1,184 @@
+"use client";
+
+import Link from "next/link";
+import { Slider } from "@/components/ui/slider";
+import { Check } from "lucide-react";
+import { useState } from "react";
+
+// Available event tiers for the slider
+const EVENT_TIERS = [
+ 100_000, 250_000, 500_000, 1_000_000, 2_000_000, 5_000_000, 10_000_000,
+];
+
+// Define plan features
+const PRO_FEATURES = [
+ "Unlimited websites",
+ "Unlimited team members",
+ "Real-time analytics",
+ "Custom events",
+ "Funnels & user flows",
+ "All features"
+];
+
+// Format price with dollar sign
+function getFormattedPrice(eventLimit, isAnnual) {
+ // Monthly prices from stripe.ts
+ let monthlyPrice;
+ if (eventLimit <= 100_000) monthlyPrice = 19;
+ else if (eventLimit <= 250_000) monthlyPrice = 29;
+ else if (eventLimit <= 500_000) monthlyPrice = 49;
+ else if (eventLimit <= 1_000_000) monthlyPrice = 69;
+ else if (eventLimit <= 2_000_000) monthlyPrice = 99;
+ else if (eventLimit <= 5_000_000) monthlyPrice = 129;
+ else monthlyPrice = 169; // 10M events
+
+ // Annual prices are 10x monthly (2 months free)
+ const annualPrice = monthlyPrice * 10;
+ return {
+ monthly: monthlyPrice,
+ annual: annualPrice
+ };
+}
+
+export function PricingSection() {
+ const [eventLimitIndex, setEventLimitIndex] = useState(0); // Default to 100k (index 0)
+ const [isAnnual, setIsAnnual] = useState(true);
+
+ const eventLimit = EVENT_TIERS[eventLimitIndex];
+ const prices = getFormattedPrice(eventLimit, isAnnual);
+
+ // Handle slider changes
+ function handleSliderChange(value) {
+ setEventLimitIndex(value[0]);
+ }
+
+ return (
+ <section className="py-16 md:py-24 w-full">
+ <div className="max-w-7xl mx-auto px-4">
+ <div className="text-center mb-12">
+ <div className="inline-block bg-emerald-900/30 text-emerald-400 px-3 py-1 rounded-full text-sm font-medium mb-4">
+ Simple Pricing
+ </div>
+ <h2 className="text-3xl md:text-4xl font-bold">Transparent Pricing</h2>
+ <p className="mt-4 text-neutral-300 max-w-2xl mx-auto">
+ Privacy-friendly analytics with all the features you need to grow
+ </p>
+ </div>
+
+ {/* Pricing card with background gradients */}
+ <div className="relative max-w-lg mx-auto mb-10">
+ {/* Background gradients - overlapping circles for organic feel */}
+ <div className="absolute top-0 left-0 w-[400px] h-[400px] bg-emerald-500/30 rounded-full blur-[80px] opacity-60"></div>
+ <div className="absolute top-20 left-20 w-[300px] h-[300px] bg-emerald-600/20 rounded-full blur-[70px] opacity-40"></div>
+
+ <div className="absolute bottom-0 right-0 w-[350px] h-[350px] bg-blue-500/30 rounded-full blur-[80px] opacity-50"></div>
+ <div className="absolute bottom-40 right-20 w-[250px] h-[250px] bg-indigo-500/20 rounded-full blur-[75px] opacity-40"></div>
+
+ <div className="absolute top-1/4 right-0 w-[200px] h-[200px] bg-purple-500/30 rounded-full blur-[70px] opacity-40"></div>
+
+ <div className="absolute bottom-1/3 left-0 w-[220px] h-[220px] bg-emerald-400/20 rounded-full blur-[70px] opacity-50"></div>
+
+ <div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[350px] h-[350px] bg-indigo-400/20 rounded-full blur-[80px] opacity-40"></div>
+
+ {/* Card with relative positioning and higher z-index */}
+ <div className="relative z-10 bg-neutral-800/50 rounded-xl border border-neutral-700 overflow-hidden backdrop-blur-sm shadow-xl">
+ <div className="p-6">
+ {/* Slider section */}
+ <div className="mb-6">
+ <div className="flex justify-between mb-3 items-center">
+ <div>
+ <h3 className="font-semibold mb-2">Events per month</h3>
+ <div className="text-3xl font-bold text-emerald-400">
+ {eventLimit.toLocaleString()}
+ </div>
+ </div>
+ <div className="flex flex-col items-end">
+ {/* Billing toggle */}
+ <div className="flex gap-3 mb-2 text-sm">
+ <button
+ onClick={() => setIsAnnual(false)}
+ className={`px-3 py-1 rounded-full transition-colors ${!isAnnual
+ ? "bg-emerald-500/20 text-emerald-400 font-medium"
+ : "text-neutral-400 hover:text-neutral-200"}`}
+ >
+ Monthly
+ </button>
+ <button
+ onClick={() => setIsAnnual(true)}
+ className={`px-3 py-1 rounded-full transition-colors ${isAnnual
+ ? "bg-emerald-500/20 text-emerald-400 font-medium"
+ : "text-neutral-400 hover:text-neutral-200"}`}
+ >
+ Annual
+ <span className="ml-1 text-xs text-emerald-500">-17%</span>
+ </button>
+ </div>
+ <div className="text-right">
+ {isAnnual ? (
+ <>
+ <span className="text-3xl font-bold">${prices.annual}</span>
+ <span className="ml-1 text-neutral-400">
+ /year
+ </span>
+ <div className="text-sm text-neutral-400">
+ ${Math.round(prices.annual / 12)}/mo
+ </div>
+ </>
+ ) : (
+ <>
+ <span className="text-3xl font-bold">${prices.monthly}</span>
+ <span className="ml-1 text-neutral-400">
+ /month
+ </span>
+ </>
+ )}
+ </div>
+ </div>
+ </div>
+
+ <Slider
+ defaultValue={[0]}
+ max={EVENT_TIERS.length - 1}
+ min={0}
+ step={1}
+ onValueChange={handleSliderChange}
+ className="mb-3"
+ />
+
+ <div className="flex justify-between text-xs text-neutral-400">
+ {EVENT_TIERS.map((tier, index) => (
+ <span
+ key={index}
+ className={eventLimitIndex === index ? "font-bold text-emerald-400" : ""}
+ >
+ {tier >= 1_000_000 ? `${tier / 1_000_000}M` : `${tier / 1_000}K`}
+ </span>
+ ))}
+ </div>
+ </div>
+
+ <div className="space-y-4 mb-6">
+ {PRO_FEATURES.map((feature, i) => (
+ <div key={i} className="flex items-center">
+ <Check className="h-4 w-4 text-emerald-400 mr-3 shrink-0" />
+ <span>{feature}</span>
+ </div>
+ ))}
+ </div>
+
+ <Link href="https://demo.rybbit.io/signup" className="w-full block">
+ <button className="w-full bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-5 py-3 rounded-lg shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50">
+ Start your 14 day free trial
+ </button>
+ </Link>
+
+ <p className="text-center text-sm text-neutral-400 mt-4">
+ No credit card required. Cancel anytime.
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </section>
+ );
+}
\ No newline at end of file
diff --git a/docs/src/app/page.jsx b/docs/src/app/page.jsx
index 701a477ef..b85e326f9 100644
--- a/docs/src/app/page.jsx
+++ b/docs/src/app/page.jsx
@@ -12,7 +12,7 @@ import { UserProfiles } from "./components/Cards/UserProfiles";
import { UserSessions } from "./components/Cards/UserSessions";
import { Integrations } from "./components/integrations";
import { Logo } from "./components/Logo";
-
+import { PricingSection } from "./components/PricingSection";
const tilt_wrap = Tilt_Warp({
subsets: ["latin"],
@@ -137,6 +137,9 @@ export default function IndexPage() {
<Integrations />
+ {/* Pricing Section */}
+ <PricingSection />
+
{/* FAQ Section */}
<section className="py-16 md:py-24 w-full">
<div className="max-w-4xl mx-auto px-4">
@@ -225,6 +228,14 @@ export default function IndexPage() {
Yes, Rybbit is 100% open source. Every single line of code, including for our cloud/enterprise offerings, is available on GitHub under the AGPL 3.0 license.
</AccordionContent>
</AccordionItem>
+ <AccordionItem value="item-8" className="border-t border-neutral-700/50">
+ <AccordionTrigger className="px-6 py-4 text-base md:text-lg font-medium hover:text-emerald-400 transition-colors">
+ What counts as an event?
+ </AccordionTrigger>
+ <AccordionContent className="px-6 pb-4 text-neutral-300">
+ An event is either a pageview or a custom event that you create on your website. Pageviews are tracked automatically, while custom events can be defined to track specific user interactions.
+ </AccordionContent>
+ </AccordionItem>
</Accordion>
</div>
</div>
@@ -250,7 +261,7 @@ export default function IndexPage() {
<div className="flex flex-col sm:flex-row items-center justify-center gap-4 md:gap-6 mb-6 md:mb-8 w-full sm:w-auto">
<Link href="https://demo.rybbit.io/signup" className="w-full sm:w-auto">
<button className="w-full sm:w-auto bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-6 md:px-8 py-3 md:py-4 rounded-lg shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50">
- Start 14 day free trial
+ Start your 14 day free trial
</button>
</Link>
<Link href="https://docs.tomato.gg" className="w-full sm:w-auto">
@@ -264,7 +275,7 @@ export default function IndexPage() {
<svg className="w-3 h-3 md:w-4 md:h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
- No credit card required.
+ No credit card required. Cancel anytime.
</p>
</div>
</div>
diff --git a/docs/src/app/pricing/metadata.js b/docs/src/app/pricing/metadata.js
deleted file mode 100644
index 93b40e851..000000000
--- a/docs/src/app/pricing/metadata.js
+++ /dev/null
@@ -1,4 +0,0 @@
-export const metadata = {
- title: "Pricing",
- description: "Rybbit Analytics pricing",
-};
diff --git a/docs/src/app/pricing/page.jsx b/docs/src/app/pricing/page.jsx
index 7d340bd47..3cb1d4a47 100644
--- a/docs/src/app/pricing/page.jsx
+++ b/docs/src/app/pricing/page.jsx
@@ -1,208 +1,40 @@
-"use client";
+import { PricingSection } from "../components/PricingSection";
-import Link from "next/link";
-import { Slider } from "@/components/ui/slider";
-import { Check } from "lucide-react";
-import { useState } from "react";
-// Available event tiers for the slider
-const EVENT_TIERS = [
- 100_000, 250_000, 500_000, 1_000_000, 2_000_000, 5_000_000, 10_000_000,
-];
-
-// Define plan features
-const PRO_FEATURES = [
- "Unlimited websites",
- "Unlimited team members",
- "Real-time analytics",
- "Custom events",
- "Funnels & user flows",
- "All features"
-];
-
-// Format price with dollar sign
-function getFormattedPrice(eventLimit, isAnnual) {
- // Monthly prices from stripe.ts
- let monthlyPrice;
- if (eventLimit <= 100_000) monthlyPrice = 19;
- else if (eventLimit <= 250_000) monthlyPrice = 29;
- else if (eventLimit <= 500_000) monthlyPrice = 49;
- else if (eventLimit <= 1_000_000) monthlyPrice = 69;
- else if (eventLimit <= 2_000_000) monthlyPrice = 99;
- else if (eventLimit <= 5_000_000) monthlyPrice = 129;
- else monthlyPrice = 169; // 10M events
-
- // Annual prices are 10x monthly (2 months free)
- const annualPrice = monthlyPrice * 10;
- return {
- monthly: monthlyPrice,
- annual: annualPrice
- };
-}
+export const metadata = {
+ title: "Pricing",
+ description: "Rybbit pricing plans and features",
+};
export default function Pricing() {
- const [eventLimitIndex, setEventLimitIndex] = useState(0); // Default to 100k (index 0)
- const [isAnnual, setIsAnnual] = useState(true);
-
- const eventLimit = EVENT_TIERS[eventLimitIndex];
- const prices = getFormattedPrice(eventLimit, isAnnual);
-
- // Handle slider changes
- function handleSliderChange(value) {
- setEventLimitIndex(value[0]);
- }
-
return (
<div className="flex flex-col items-center justify-center overflow-x-hidden">
- <div className="container mx-auto py-12 px-4">
- <div className="mb-10 text-center max-w-3xl mx-auto">
- <h1 className="text-4xl md:text-5xl font-bold tracking-tight pb-4 text-transparent bg-clip-text bg-gradient-to-b from-white via-gray-200 to-gray-400">
- Simple, Transparent Pricing
- </h1>
- <p className="text-lg text-neutral-300 mb-6">
- Privacy-friendly analytics with all the features you need to grow
- </p>
- </div>
-
- {/* Pricing card with background gradients */}
- <div className="relative max-w-lg mx-auto mb-10">
- {/* Background gradients - overlapping circles for organic feel */}
- <div className="absolute top-0 left-0 w-[400px] h-[400px] bg-emerald-500/30 rounded-full blur-[80px] opacity-60"></div>
- <div className="absolute top-20 left-20 w-[300px] h-[300px] bg-emerald-600/20 rounded-full blur-[70px] opacity-40"></div>
-
- <div className="absolute bottom-0 right-0 w-[350px] h-[350px] bg-blue-500/30 rounded-full blur-[80px] opacity-50"></div>
- <div className="absolute bottom-40 right-20 w-[250px] h-[250px] bg-indigo-500/20 rounded-full blur-[75px] opacity-40"></div>
+ <PricingSection />
+
+ {/* FAQ section */}
+ <div className="max-w-lg mx-auto px-4 pb-16">
+ <div className="mt-10 space-y-6">
+ <h3 className="text-xl font-semibold mb-4">Frequently Asked Questions</h3>
- <div className="absolute top-1/4 right-0 w-[200px] h-[200px] bg-purple-500/30 rounded-full blur-[70px] opacity-40"></div>
-
- <div className="absolute bottom-1/3 left-0 w-[220px] h-[220px] bg-emerald-400/20 rounded-full blur-[70px] opacity-50"></div>
+ <div className="bg-neutral-800/20 p-5 rounded-lg border border-neutral-700">
+ <h4 className="font-medium mb-2">What counts as an event?</h4>
+ <p className="text-neutral-300">
+ An event is either a pageview or a custom event that you create on your website. Pageviews are tracked automatically, while custom events can be defined to track specific user interactions.
+ </p>
+ </div>
- <div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[350px] h-[350px] bg-indigo-400/20 rounded-full blur-[80px] opacity-40"></div>
-
- {/* Card with relative positioning and higher z-index */}
- <div className="relative z-10 bg-neutral-800/50 rounded-xl border border-neutral-700 overflow-hidden backdrop-blur-sm shadow-xl">
- <div className="p-6">
- {/* Slider section */}
- <div className="mb-6">
- <div className="flex justify-between mb-3 items-center">
- <div>
- <h3 className="font-semibold mb-2">Events per month</h3>
- <div className="text-3xl font-bold text-emerald-400">
- {eventLimit.toLocaleString()}
- </div>
- </div>
- <div className="flex flex-col items-end">
- {/* Billing toggle */}
- <div className="flex gap-3 mb-2 text-sm">
- <button
- onClick={() => setIsAnnual(false)}
- className={`px-3 py-1 rounded-full transition-colors ${!isAnnual
- ? "bg-emerald-500/20 text-emerald-400 font-medium"
- : "text-neutral-400 hover:text-neutral-200"}`}
- >
- Monthly
- </button>
- <button
- onClick={() => setIsAnnual(true)}
- className={`px-3 py-1 rounded-full transition-colors ${isAnnual
- ? "bg-emerald-500/20 text-emerald-400 font-medium"
- : "text-neutral-400 hover:text-neutral-200"}`}
- >
- Annual
- <span className="ml-1 text-xs text-emerald-500">-17%</span>
- </button>
- </div>
- <div className="text-right">
- {isAnnual ? (
- <>
- <span className="text-3xl font-bold">${prices.annual}</span>
- <span className="ml-1 text-neutral-400">
- /year
- </span>
- <div className="text-sm text-neutral-400">
- ${Math.round(prices.annual / 12)}/mo
- </div>
- </>
- ) : (
- <>
- <span className="text-3xl font-bold">${prices.monthly}</span>
- <span className="ml-1 text-neutral-400">
- /month
- </span>
- </>
- )}
- </div>
- </div>
- </div>
-
- <Slider
- defaultValue={[0]}
- max={EVENT_TIERS.length - 1}
- min={0}
- step={1}
- onValueChange={handleSliderChange}
- className="mb-3"
- />
-
- <div className="flex justify-between text-xs text-neutral-400">
- {EVENT_TIERS.map((tier, index) => (
- <span
- key={index}
- className={eventLimitIndex === index ? "font-bold text-emerald-400" : ""}
- >
- {tier >= 1_000_000 ? `${tier / 1_000_000}M` : `${tier / 1_000}K`}
- </span>
- ))}
- </div>
- </div>
-
- <div className="space-y-4 mb-6">
- {PRO_FEATURES.map((feature, i) => (
- <div key={i} className="flex items-center">
- <Check className="h-4 w-4 text-emerald-400 mr-3 shrink-0" />
- <span>{feature}</span>
- </div>
- ))}
- </div>
-
- <Link href="https://demo.rybbit.io/signup" className="w-full block">
- <button className="w-full bg-emerald-600 hover:bg-emerald-500 text-white font-medium px-5 py-3 rounded-lg shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50">
- Start your 14 day free trial
- </button>
- </Link>
-
- <p className="text-center text-sm text-neutral-400 mt-4">
- No credit card required. Cancel anytime.
- </p>
- </div>
+ <div className="bg-neutral-800/20 p-5 rounded-lg border border-neutral-700">
+ <h4 className="font-medium mb-2">Can I change my plan later?</h4>
+ <p className="text-neutral-300">
+ Absolutely. You can upgrade, downgrade, or cancel your plan at any time through your account settings.
+ </p>
</div>
- </div>
- {/* FAQ section */}
- <div className="max-w-lg mx-auto">
- <div className="mt-10 space-y-6">
- <h3 className="text-xl font-semibold mb-4">Frequently Asked Questions</h3>
-
- <div className="bg-neutral-800/20 p-5 rounded-lg border border-neutral-700">
- <h4 className="font-medium mb-2">What counts as an event?</h4>
- <p className="text-neutral-300">
- An event is either a pageview or a custom event that you create on your website. Pageviews are tracked automatically, while custom events can be defined to track specific user interactions.
- </p>
- </div>
-
- <div className="bg-neutral-800/20 p-5 rounded-lg border border-neutral-700">
- <h4 className="font-medium mb-2">Can I change my plan later?</h4>
- <p className="text-neutral-300">
- Absolutely. You can upgrade, downgrade, or cancel your plan at any time through your account settings.
- </p>
- </div>
-
- <div className="bg-neutral-800/20 p-5 rounded-lg border border-neutral-700">
- <h4 className="font-medium mb-2">What happens if I go over my event limit?</h4>
- <p className="text-neutral-300">
- We'll notify you when you're approaching your limit. You can either upgrade to a higher plan or continue with your current plan (events beyond the limit won't be tracked). Remember, an event is either a pageview or a custom event you've defined.
- </p>
- </div>
+ <div className="bg-neutral-800/20 p-5 rounded-lg border border-neutral-700">
+ <h4 className="font-medium mb-2">What happens if I go over my event limit?</h4>
+ <p className="text-neutral-300">
+ We'll notify you when you're approaching your limit. You can either upgrade to a higher plan or continue with your current plan (events beyond the limit won't be tracked). Remember, an event is either a pageview or a custom event you've defined.
+ </p>
</div>
</div>
</div>