@molecule/app-subscription-plan-card-svelte

Feature · subscription-plan-card · App (browser) · v1.1.3 · Apache-2.0

Pricing / plan card with features, price + interval, primary CTA, recommended badge

npm install @molecule/app-subscription-plan-card-svelte

npm · Source on GitHub

How it works

@molecule/app-subscription-plan-card-svelte is a ready-made subscription-plan-card feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

<script lang="ts">
  import { SubscriptionPlanCard } from '@molecule/app-subscription-plan-card-svelte'

  const features = ['Unlimited projects', '10 GB storage', 'Priority support']
</script>

<SubscriptionPlanCard
  name="Pro"
  price="$19"
  interval="/month"
  {features}
  ctaLabel="Get started"
  onCta={() => goto('/checkout/pro')}
  recommended
  badge="Most popular"
/>

Works with: @molecule/app-svelte, @molecule/app-ui, @molecule/app-ui-svelte

Reference

Svelte pricing / subscription plan card — the Svelte counterpart of @molecule/app-subscription-plan-card-react, with the same props and the same DOM for the same input.

Exports SubscriptionPlanCard — header (badge + name + description), price

  • interval, feature checklist, and a primary CTA (button or link).

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

<script lang="ts">
  import { SubscriptionPlanCard } from '@molecule/app-subscription-plan-card-svelte'

  const features = ['Unlimited projects', '10 GB storage', 'Priority support']
</script>

<SubscriptionPlanCard
  name="Pro"
  price="$19"
  interval="/month"
  {features}
  ctaLabel="Get started"
  onCta={() => goto('/checkout/pro')}
  recommended
  badge="Most popular"
/>

Type

feature

Installation

npm install @molecule/app-subscription-plan-card-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte

API

Interfaces

SubscriptionPlanCardProps

Props accepted by the SubscriptionPlanCard component.

interface SubscriptionPlanCardProps {
  /** Plan name (e.g. "Pro", "Team", "Enterprise") — a snippet or a plain string. */
  name: Snippet | string
  /** Optional tagline / one-liner — a snippet or a plain string. */
  description?: Snippet | string
  /** Price string ("$19", "Free", "Custom") — a snippet or a plain string. */
  price: Snippet | string
  /** Billing interval label ("/month", "/yr", "per seat") — a snippet or a plain string. */
  interval?: Snippet | string
  /** Bullet feature list; each entry is a snippet or a plain string. */
  features: (Snippet | string)[]
  /** Primary CTA button label — a snippet or a plain string. */
  ctaLabel?: Snippet | string
  /** Click / nav handler (receives the click event, as React's CTA does). */
  onCta?: (event?: MouseEvent) => void
  /** When set, the CTA renders as a plain anchor to this URL. */
  ctaHref?: string
  /** Visually highlight as the recommended / popular plan. */
  recommended?: boolean
  /** Optional badge content (e.g. "Most popular") — a snippet or a plain string. */
  badge?: Snippet | string
  /** Extra classes. */
  className?: string
}

Constants

SubscriptionPlanCard

const SubscriptionPlanCard: LegacyComponentType

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-svelte ^3.14.0 || ^4.0.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-svelte ^1.1.0
  • svelte ^5.0.0

Runtime Dependencies

  • @molecule/app-svelte

  • @molecule/app-ui

  • @molecule/app-ui-svelte

  • svelte

  • Must render with the app's i18n and ClassMap providers wired (useTranslation() / getClassMap() fall back to the bonded providers, and throw when neither is wired).

  • Prefer onCta with your router's navigate function for SPA navigation; ctaHref renders a plain anchor and causes a full page load.

  • recommended highlights the card (outline + primary CTA color) and, when badge is omitted, shows a "Recommended" badge via the plan.recommended i18n key.

  • price/interval are opaque display nodes — the app owns currency formatting and localization.

  • Node-valued props (name, description, price, interval, ctaLabel, badge, and each features entry) are snippets or plain strings.

Translations

Translation strings are provided by @molecule/app-locales-subscription-plan-card.