pricing-1
efferd/pricing-1FreeBlock
Responsive pricing section with frequency toggle, tooltips, and highlightable plans.
Install it
npx shadcn@latest add https://legacy.efferd.com/r/pricing-1.jsonSource
1"use client";2import { CheckCircleIcon, StarIcon } from "lucide-react";3import Link from "next/link";4import React from "react";5import { Button } from "@/components/ui/button";6import {7 Tooltip,8 TooltipContent,9 TooltipProvider,10 TooltipTrigger,11} from "@/components/ui/tooltip";12import { cn } from "@/lib/utils";13import { type FREQUENCY, FrequencyToggle } from "./frequency-toggle";1415export type Plan = {16 name: string;17 info: string;18 price: {19 monthly: number;20 yearly: number;21 };22 features: {23 text: string;24 tooltip?: string;25 }[];26 btn: {27 text: string;28 href: string;29 };30 highlighted?: boolean;31};3233interface PricingSectionProps extends React.ComponentProps<"div"> {34 plans: Plan[];35 heading: string;36 description?: string;37}3839export function PricingSection({40 plans,41 heading,42 description,43 ...props44}: PricingSectionProps) {45 const [frequency, setFrequency] = React.useState<"monthly" | "yearly">(46 "monthly"47 );4849 return (50 <div51 className={cn(52 "flex w-full flex-col items-center justify-center space-y-7 p-4",53 props.className54 )}55 {...props}56 >57 <div className="mx-auto max-w-xl space-y-2">58 <h2 className="text-center font-bold text-2xl tracking-tight md:text-3xl lg:font-extrabold lg:text-4xl">59 {heading}60 </h2>61 {description && (62 <p className="text-center text-muted-foreground text-sm md:text-base">63 {description}64 </p>65 )}66 </div>6768 <FrequencyToggle frequency={frequency} setFrequency={setFrequency} />69 <div className="mx-auto grid w-full max-w-4xl grid-cols-1 gap-6 md:grid-cols-3">70 {plans.map((plan) => (71 <PricingCard frequency={frequency} key={plan.name} plan={plan} />72 ))}73 </div>74 </div>75 );76}7778type PricingCardProps = React.ComponentProps<"div"> & {79 plan: Plan;80 frequency?: FREQUENCY;81};8283export function PricingCard({84 plan,85 className,86 frequency = "monthly",87 ...props88}: PricingCardProps) {89 return (90 <div91 className={cn(92 "relative flex w-full flex-col rounded-lg border shadow",93 plan.highlighted && "scale-105",94 className95 )}96 key={plan.name}97 {...props}98 >99 <div100 className={cn(101 "rounded-t-lg border-b p-4",102 plan.highlighted && "bg-card dark:bg-card/80"103 )}104 >105 <div className="absolute top-2 right-2 z-10 flex items-center gap-2">106// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from efferd
All 40 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| auth-1auth-1 | efferd | Blocks | Free | no deps · 2 files | |
| auth-2auth-2 | efferd | Blocks | Free | 1 dep · 3 files | |
| contact-1contact-1 | efferd | Blocks | Free | no deps | |
| contact-2contact-2 | efferd | Blocks | Free | no deps | |
| cta-1cta-1 | efferd | Blocks | Free | no deps | |
| cta-2cta-2 | efferd | Blocks | Free | no deps | |
| cta-3cta-3 | efferd | Blocks | Free | no deps | |
| cta-4cta-4 | efferd | Blocks | Free | no deps |
