Pricing
Plan cards and a plan picker for lit-material: prices, features, the current plan, monthly or yearly billing.
- 7.6 KB gzipped
- @lit-material/pricing 1.8.0
- Renders on the server
Example
Pricing
Plans side by side from data: a Monthly / Yearly switch when plans have both prices, the plan the reader is on and the suggested one marked in words, and a button per plan. The picker only reports the choice; open the checkout in your handler.
-
Free
Current planFor one person
$0
- 3 workspaces
- 7 days of run history
Current plan -
Team
RecommendedFor teams sharing collections
$8 per seat / month
- Unlimited workspaces
- 90 days of run history
- Roles and invites
Upgrade -
Business
For organizations
$16 per seat / month
- Everything in Team
- Single sign-on and SCIM
- Signed audit export
Upgrade
One card
lit-material-plan-card on its own, with your own button in the action slot.
Enterprise
Your own server, our support
Custom
- Self-hosted
- Support agreement
Install
npm install @lit-material/pricing @lit-material/tokens
import "@lit-material/pricing";
Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide
API
<lit-material-plan-card>
One plan: name, price, what it includes and an action. Marks the plan the
reader is on (current) and the one to suggest (recommended) in words,
not only by colour. Use it alone, or let lit-material-plan-picker lay
several out from data.
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
name | name | string | "" | The plan's name. |
description | description | string | "" | One line under the name: who it's for. |
price | price | string | "" | The price as it should read, formatted by the app: "$12", "Free", "Custom". |
period | period | string | "" | After the price: "per seat / month". |
priceNote | price-note | string | "" | A line under the price: "billed yearly", "2 months free". |
features | features | string[] | [] | What the plan includes, one entry per line. |
current | current | boolean | false | The plan the reader is on. |
recommended | recommended | boolean | false | The plan to suggest. current wins when both are set. |
headingLevel | heading-level | number | 3 | Level of the name's heading, so cards fit the page's outline. |
Slots
| Slot | Description |
|---|---|
| default | Extra content under the features, e.g. a limits table or a note. |
action | The plan's button, e.g. "Upgrade" or "Contact sales". |
CSS parts
| Part | Description |
|---|---|
card | The outlined box. |
badge | The "Current plan" / "Recommended" label. |
price | The price line. |
features | The feature list. |
CSS custom properties
| Property | Description |
|---|---|
--lit-material-plan-card-shape | Corner radius (default --md-sys-shape-corner-large). |
<lit-material-plan-picker>
Plans side by side from data, for a pricing page or an account's plan page:
a Monthly / Yearly switch when any plan has both prices, one
lit-material-plan-card per plan, and a button per plan. The picker only
reports the choice: open the checkout, confirm or change the plan in the
lit-material-plan-select handler.
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
plans | plans | Plan[] | [] | > |
period | period | BillingPeriod | "monthly" | The billing period shown. |
periodNote | period-note | string | "" | Next to the switch, e.g. "Yearly: 2 months free". |
headingLevel | heading-level | number | 3 | Level of each plan name's heading. |
Events
| Event | Description |
|---|---|
lit-material-period-change | The billing period switched; detail is { period }. |
lit-material-plan-select | A plan's button was pressed; detail is { plan, period }. |
CSS parts
| Part | Description |
|---|---|
switch | The Monthly / Yearly switch. |
plans | The grid of cards. |
CSS custom properties
| Property | Description |
|---|---|
--lit-material-plan-picker-min-card-width | Narrowest card before the grid wraps (default 240px). |