Skip to content
Calm motion: animations on this site only fade, with no movement

Paywall ​

The end of a free preview, with the plans and a sign-in link

Stops a reader at the end of the free part of an article, and offers a subscription. For a full page of plans, use the pricing table.

Basic

Most home studios fail for one reason: the room. Before you spend on a new microphone, listen to how your voice comes back from the walls. Clap once and count the echo. Then try the same clap in front of an open wardrobe.

Read the rest of this article

Subscribe to read every article, with no limit.

Plans
  • Put the free part of the text in the default slot. Its end fades into the box below.
  • plans is a list of plans. Each plan has an id, a name, and a price as text, and an optional note.
  • The plans are native radio buttons. pick sets the plan that is picked at first. "Subscribe" emits subscribe with the id of the plan.
  • signInHref adds a link for readers who already pay.
  • Plans can load after the box shows. pick chooses the plan at first, and if that plan is not in the list, the first plan is chosen.
  • The box is a section named by its title.
  • Show only the free part on the page. Do not send the rest of the article to the browser and hide it, because anyone can read hidden text.
  • Change the words with labels or a label pack: title, body, subscribe, signIn, and plans.

Usage ​

ts
import { BlessPaywall } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
plans*BlessPaywallPlan[]—
pickstring—the id of the plan that is picked at first
signInHrefstring—the sign-in page, for readers who already pay
labelsPartial<{ title: string; body: string; subscribe: string; signIn: string; plans: string; }>—

Events

NamePayloadDescription
subscribe[planId: string]

Slots

NameScopeDescription
default—

Released under the MIT License. Character names and artwork belong to their owners.