Pricing Card One
shadcn-extras/pricing-card-oneFreeComponent
Pricing card with icon, price, features, and CTA.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/NayanDevLab/shadcn-extras/dev/public/c/pricing-card-one.jsonSource
1'use client';23import * as React from 'react';4import { cn } from '@/lib/utils';56type AnchorOrButton =7 | ({8 href: string;9 onClick?: never;10 } & React.AnchorHTMLAttributes<HTMLAnchorElement>)11 | ({12 href?: undefined;13 onClick?: React.MouseEventHandler<HTMLButtonElement>;14 } & React.ButtonHTMLAttributes<HTMLButtonElement>);1516type Tone = 'indigo' | 'blue' | 'emerald' | 'zinc';17type Variant = 'outline' | 'elevated' | 'soft';1819export type PricingFeature = {20 label: React.ReactNode;21 included?: boolean; // default true22};2324export type PricingCardOneProps = {25 icon?: React.ReactNode; // big top icon26 name: string; // plan name27 subtitle?: string; // "the starter choice"28 price: number | string; // 5 | "$5"29 currency?: string; // "$" (used when price is number)30 periodLabel?: string; // "/month"31 recommended?: boolean;32 recommendedLabel?: string;3334 features: PricingFeature[];3536 /** CTA button/link. If omitted, no button is shown. */37 cta?: AnchorOrButton & { label?: string; 'aria-label'?: string };3839 /** Visuals */40 tone?: Tone;41 variant?: Variant;42 className?: string;4344 /** Slot style overrides */45 badgeClassName?: string;46 iconClassName?: string;47 nameClassName?: string;48 subtitleClassName?: string;49 priceClassName?: string;50 periodClassName?: string;51 featureListClassName?: string;52 featureItemClassName?: string;53 ctaClassName?: string;54};5556const toneMap: Record<57 Tone,58 {59 accent: string; // text color for icon/price60 ring: string; // ring color for included bullet61 bulletOkBg: string; // bg for ✓62 bulletOkFg: string;63 bulletNoBg: string; // bg for ✕64 bulletNoFg: string;65 primaryBtn: string; // filled button66 primaryBtnHover: string;67 outlineBtn: string; // outline button text/ring68 }69> = {70 indigo: {71 accent: 'text-indigo-600',72 ring: 'ring-indigo-200 dark:ring-indigo-900/50',73 bulletOkBg: 'bg-indigo-50 dark:bg-indigo-950/40',74 bulletOkFg: 'text-indigo-600 dark:text-indigo-400',75 bulletNoBg: 'bg-amber-50 dark:bg-amber-950/40',76 bulletNoFg: 'text-amber-500',77 primaryBtn: 'bg-indigo-600 text-white',78 primaryBtnHover: 'hover:bg-indigo-700',79 outlineBtn:80 'text-indigo-600 ring-1 ring-inset ring-indigo-200 dark:ring-indigo-900/50',81 },82 blue: {83 accent: 'text-blue-600',84 ring: 'ring-blue-200 dark:ring-blue-900/50',85 bulletOkBg: 'bg-blue-50 dark:bg-blue-950/40',86 bulletOkFg: 'text-blue-600 dark:text-blue-400',87// … truncated
Files it writes
More from shadcn-extras
All 33 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Image Gridanimated-image-grid | shadcn-extras | Components | Free | no deps · 3 files | |
| Blog Card Fourblog-card-four | shadcn-extras | Components | Free | 1 dep | |
| Blog Card Oneblog-card-one | shadcn-extras | Components | Free | no deps | |
| Blog Card Threeblog-card-three | shadcn-extras | Components | Free | 1 dep | |
| Blog Card Twoblog-card-two | shadcn-extras | Components | Free | 1 dep | |
| Bulb Iconbulb-icon | shadcn-extras | Components | Free | 2 deps | |
| Chevron Stepschevron-steps | shadcn-extras | Components | Free | no deps | |
| Circular Gallerycircular-gallery | shadcn-extras | Components | Free | no deps · 3 files |
