@molecule/app-subscription-plan-card-vue
Feature · subscription-plan-card · App (browser) · v1.1.2 · Apache-2.0
Pricing / plan card with features, price + interval, primary CTA, recommended badge
npm install @molecule/app-subscription-plan-card-vueHow it works
@molecule/app-subscription-plan-card-vue 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.
import { defineComponent, h } from 'vue'
import { SubscriptionPlanCard } from '@molecule/app-subscription-plan-card-vue'
declare function navigate(to: string): void
const Plans = defineComponent({
setup() {
return () =>
h(SubscriptionPlanCard, {
name: 'Pro',
price: '$19',
interval: '/month',
features: ['Unlimited projects', '10 GB storage', 'Priority support'],
ctaLabel: 'Get started',
onCta: () => navigate('/checkout/pro'),
recommended: true,
badge: 'Most popular',
})
},
})Works with: @molecule/app-ui, @molecule/app-ui-vue, @molecule/app-vue
Reference
Vue pricing / subscription plan card.
Exports SubscriptionPlanCard — header (badge + name + description), price
- interval, feature checklist, and a primary CTA (button or link). It is the
Vue counterpart of
@molecule/app-subscription-plan-card-react: the same props (React names), the same ClassMap tokens, and the same DOM for the same input.
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.tsJSDoc, not this file.
Quick Start
import { defineComponent, h } from 'vue'
import { SubscriptionPlanCard } from '@molecule/app-subscription-plan-card-vue'
declare function navigate(to: string): void
const Plans = defineComponent({
setup() {
return () =>
h(SubscriptionPlanCard, {
name: 'Pro',
price: '$19',
interval: '/month',
features: ['Unlimited projects', '10 GB storage', 'Priority support'],
ctaLabel: 'Get started',
onCta: () => navigate('/checkout/pro'),
recommended: true,
badge: 'Most popular',
})
},
})
Type
feature
Installation
npm install @molecule/app-subscription-plan-card-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
API
Interfaces
SubscriptionPlanCardProps
Props for the SubscriptionPlanCard component.
interface SubscriptionPlanCardProps {
/**
* Plan name (e.g. "Pro", "Team", "Enterprise"). Passed as a prop or as the
* same-named slot — both work.
*/
name?: VNodeChild
/** Optional tagline / one-liner — a prop or the same-named slot. */
description?: VNodeChild
/**
* Price string ("$19", "Free", "Custom") — apps own currency formatting.
* Passed as a prop or as the same-named slot.
*/
price?: VNodeChild
/** Billing interval label ("/month", "/yr", "per seat") — a prop or the same-named slot. */
interval?: VNodeChild
/** Bullet feature list. */
features: VNodeChild[]
/** Primary CTA button label — a prop or the same-named slot. */
ctaLabel?: VNodeChild
/** 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 prop or the same-named slot. */
badge?: VNodeChild
/** Extra classes. */
className?: string
}
Constants
SubscriptionPlanCard
Pricing / subscription plan card. Renders header (badge + name + description), price + interval, feature checklist, and a primary CTA (button or link).
const SubscriptionPlanCard: DefineComponent<
ExtractPropTypes<{
name: null
description: null
price: null
interval: null
features: { type: PropType<VNodeChild[]>; required: true }
ctaLabel: null
onCta: PropType<(event?: MouseEvent) => void>
ctaHref: StringConstructor
recommended: { type: BooleanConstructor; default: boolean }
badge: null
className: StringConstructor
}>,
() => VNode,
{},
{},
{},
ComponentOptionsMixin,
ComponentOptionsMixin,
{},
string,
PublicProps,
Readonly<
ExtractPropTypes<{
name: null
description: null
price: null
interval: null
features: { type: PropType<VNodeChild[]>; required: true }
ctaLabel: null
onCta: PropType<(event?: MouseEvent) => void>
ctaHref: StringConstructor
recommended: { type: BooleanConstructor; default: boolean }
badge: null
className: StringConstructor
}>
> &
Readonly<{}>,
{ recommended: boolean },
{},
{},
{},
string,
ComponentProvideOptions,
true,
{},
any
>
props— Component props (seeSubscriptionPlanCardProps).
Returns: The subscription plan card component.
Injection Notes
Requirements
Peer dependencies:
@molecule/app-ui^1.0.1@molecule/app-ui-vue^1.1.0@molecule/app-vue^3.13.0 || ^4.0.0vue^3.4.0
Runtime Dependencies
-
@molecule/app-ui -
@molecule/app-ui-vue -
@molecule/app-vue -
vue -
Must render inside the app's i18n provider and with a ClassMap bond wired (
useTranslation()/getClassMap()fall back to the bonded providers, and throw when neither is wired). -
Prefer
onCtawith your router's navigate function for SPA navigation;ctaHrefrenders a plain anchor and causes a full page load. -
recommendedhighlights the card (outline + primary CTA color) and, whenbadgeis omitted, shows a "Recommended" badge via theplan.recommendedi18n key. -
price/intervalare opaque display nodes — the app owns currency formatting and localization. -
Node-valued props (
name,description,price,interval,ctaLabel,badge) arrive as a prop AND a same-named slot; components accept either.
Translations
Translation strings are provided by @molecule/app-locales-subscription-plan-card.