marketing/DSPricingCard

DSPricingCard

marketing
since v2.0

Subscription plan card with name, price, billing period, feature list with checkmarks, CTA, and highlighted state for the recommended plan.

iOS 17+macOS 14+

Purpose

Landing pages and upgrade screens. Clearly communicates value and differences between plans.

Interactive Reference

Live showroom

Need the full visual surface?

Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().

Best for exploring:

variants, states, categories, and real app examples in one place.

Props

PropTypeDefaultDescription
namereqStringPlan name (e.g. 'Pro').
pricereqStringFormatted price.
periodreqStringBilling period (e.g. '/month').
descriptionreqStringPlan value proposition.
featuresreq[String]List of included features.
ctaLabelreqStringCTA button text.
isHighlightedBoolfalseShows border and 'Recommended' badge.
onSelectreq(() -> Void)CTA action.

Examples

Three plans

Starter, Pro (highlighted), and Enterprise.

swift
HStack(spacing: DSSpacing.md) {
    DSPricingCard(
        name: "Starter",
        price: "Free",
        period: "",
        description: "For personal projects",
        features: ["3 projects", "1 user", "1 GB storage"],
        ctaLabel: "Get started free",
        onSelect: {}
    )
    DSPricingCard(
        name: "Pro",
        price: "$49",
        period: "/month",
        description: "For small teams",
        features: ["Unlimited projects", "5 users", "50 GB storage", "Analytics"],
        ctaLabel: "Subscribe to Pro",
        isHighlighted: true,
        onSelect: { subscribe(.pro) }
    )
}

Usage Guidelines

  • Highlight only 1 plan as recommended.
  • Keep features comparable across all cards (use — to indicate absence).

Related Components