@molecule/app-pricing-table-solid

Feature · pricing-table · App (browser) · v1.1.1 · Apache-2.0

Features × plans matrix for side-by-side plan comparison

npm install @molecule/app-pricing-table-solid

npm · Source on GitHub

How it works

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

import { PricingTable } from '@molecule/app-pricing-table-solid'

const checkout = (planId: string): void => {
  window.location.assign(`/checkout?plan=${planId}`)
}

export function Plans() {
  return (
    <PricingTable
      plans={[
        {
          id: 'starter',
          name: 'Starter',
          price: '$9',
          interval: '/mo',
          cta: { label: 'Get started', onClick: () => checkout('starter') },
        },
        {
          id: 'pro',
          name: 'Pro',
          price: '$29',
          interval: '/mo',
          recommended: true,
          cta: { label: 'Get started', onClick: () => checkout('pro') },
        },
      ]}
      features={[
        { label: 'Projects', values: { starter: '3', pro: 'Unlimited' } },
        { label: 'Team members', values: { starter: false, pro: true } },
      ]}
    />
  )
}

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

Reference

Solid side-by-side pricing comparison table.

Exports <PricingTable> and PricingPlan / PricingFeature types — the Solid counterpart of @molecule/app-pricing-table-react, with the same props and the same DOM for the same input. Switching an app from React to Solid is a change of the package name in its import.

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

import { PricingTable } from '@molecule/app-pricing-table-solid'

const checkout = (planId: string): void => {
  window.location.assign(`/checkout?plan=${planId}`)
}

export function Plans() {
  return (
    <PricingTable
      plans={[
        {
          id: 'starter',
          name: 'Starter',
          price: '$9',
          interval: '/mo',
          cta: { label: 'Get started', onClick: () => checkout('starter') },
        },
        {
          id: 'pro',
          name: 'Pro',
          price: '$29',
          interval: '/mo',
          recommended: true,
          cta: { label: 'Get started', onClick: () => checkout('pro') },
        },
      ]}
      features={[
        { label: 'Projects', values: { starter: '3', pro: 'Unlimited' } },
        { label: 'Team members', values: { starter: false, pro: true } },
      ]}
    />
  )
}

Type

feature

Installation

npm install @molecule/app-pricing-table-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js

API

Interfaces

PricingPlan

Describes a single plan column in the pricing table.

interface PricingPlan {
  /** Stable plan id; also the key its feature values are read by. */
  id: string
  /** Plan name, rendered as the column heading. */
  name: JSX.Element
  /** Optional one-line plan description. */
  description?: JSX.Element
  /** Plan price (a formatted string or a node). */
  price: JSX.Element
  /** Optional billing interval shown beside the price (e.g. `/mo`). */
  interval?: JSX.Element
  /** Call to action for this column. */
  cta?: { label: JSX.Element; onClick?: () => void; href?: string }
  /** Visually emphasise as recommended / featured. */
  recommended?: boolean
}

PricingFeature

Describes a single feature row and its per-plan values in the pricing table.

interface PricingFeature {
  /** Row label. */
  label: JSX.Element
  /** Per-plan-id values: `true` / `false` / a string / a node. */
  values: Record<string, boolean | string | JSX.Element>
  /** Optional category / group heading rendered above this row. */
  groupHeading?: JSX.Element
}

PricingTableProps

Props accepted by the PricingTable component (React's prop names).

interface PricingTableProps {
  /** The plan columns, left to right. */
  plans: PricingPlan[]
  /** The feature rows, top to bottom. */
  features: PricingFeature[]
  /** Extra classes on the outer wrapper. */
  className?: string
}

Functions

PricingTable(props)

Side-by-side pricing comparison — features × plans matrix. A header row holds plan cards (name, price, CTA); body rows show per-feature availability (true → ✓, false → —, strings/nodes pass through). The wrapper scrolls horizontally when columns overflow.

function PricingTable(props: PricingTableProps): JSX.Element
  • props — Component props (see PricingTableProps).

Returns: The rendered pricing table.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-solid ^3.5.0 || ^4.0.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-solid ^1.1.0
  • solid-js ^1.8.0

Runtime Dependencies

  • @molecule/app-solid
  • @molecule/app-ui
  • @molecule/app-ui-solid
  • solid-js

All text arrives via props — pass pre-translated strings; requires a wired ClassMap bond.