Pricing Section
Layout
Pricing tables and cards for displaying product or service pricing plans.
Import
import {
PixelPricing,
PixelPricingCard,
PixelPricingBadge,
PixelPricingTitle,
PixelPricingPrice,
PixelPricingPeriod,
PixelPricingDescription,
PixelPricingFeatures,
PixelPricingFeature,
PixelPricingActions,
PixelPricingHeader,
PixelPricingSectionTitle,
PixelPricingSectionDescription
} from "@/components/ui/pixel/pixel-pricing"Usage
Basic
$9
per month
For individuals
- ✓10 Projects
- ✓5GB Storage
- ✓Email Support
Popular
Pro
$29
per month
For teams
- ✓Unlimited Projects
- ✓50GB Storage
- ✓Priority Support
Firm
$99
per month
For organizations
- ✓Unlimited Everything
- ✓500GB Storage
- ✓24/7 Support
Component Source
Copy and paste the following code into your project at /src/components/ui/pixel/pixel-pricing.tsx
import { cva, type VariantProps } from "class-variance-authority";
import * as React from "react";
import { cn } from "@/lib/utils";
const pixelPricingVariants = cva("relative w-full", {
variants: {
variant: {
default: "bg-[#f5f5dc] dark:bg-[#1a1a1a]",
primary: "bg-[#ff8c00] text-white",
secondary: "bg-[#ffd700] text-black",
dark: "bg-black text-white",
},
columns: {
1: "grid-cols-1",
2: "grid-cols-1 md:grid-cols-2",
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4",
},
gap: {
none: "gap-0",
sm: "gap-4",
md: "gap-8",
lg: "gap-12",
xl: "gap-16",
},
},
defaultVariants: {
variant: "default",
columns: 3,
gap: "lg",
},
});
export interface PixelPricingProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof pixelPricingVariants> {
children?: React.ReactNode;
}
const PixelPricing = React.forwardRef<HTMLDivElement, PixelPricingProps>(
({ className, variant, columns, gap, children, ...props }, ref) => {
return (
<section
ref={ref}
className={cn(
pixelPricingVariants({ variant }),
"py-16 md:py-24",
className,
)}
{...props}
// ... (more code below)Props
| Prop | Type | Default | Description |
|---|---|---|---|
| columns | 2 | 3 | 4 | 3 | Number of columns in the grid |
| gap | "none" | "sm" | "md" | "lg" | "xl" | "md" | Gap between pricing cards |
| variant | "default" | "primary" | "secondary" | "dark" | "featured" | "default" | Card visual style |
Examples
Basic Pricing Cards
Simple 3-column pricing layout
Basic
$9
per month
For individuals
- ✓10 Projects
- ✓5GB Storage
- ✓Email Support
Popular
Pro
$29
per month
For teams
- ✓Unlimited Projects
- ✓50GB Storage
- ✓Priority Support
Firm
$99
per month
For organizations
- ✓Unlimited Everything
- ✓500GB Storage
- ✓24/7 Support
Accessibility
This component is built with accessibility in mind, including proper ARIA attributes, keyboard navigation, and focus management.