Skip to content
Klarhimmel UI

Pricing, packages

Pricing, packages previewPricing, packages preview

Install

npx shadcn add @klarhimmel/pricing-packages
DetailsAbout, usage, props and more

A grid of three to six packages: name, one line on what you get, how long it takes, a price or the word "Ask" (never a made-up number), an optional flag, a button each…

Import

Import

import Block from '@/components/klarhimmel/blocks/pricing-packages';
Also called
  • pricing/packages
About
A grid of three to six packages: name, one line on what you get, how long it takes, a price or the word "Ask" (never a made-up number), an optional flag, a button each, a visible "Examples" tag and an optional monthly line underneath.
Category
Plans and prices: tiers, a single plan, a toggle or a comparison table. New project? Set it up once: /get-started/installation.

Notes

When to use it

A grid of three to six fixed-scope packages, each with a duration, a price or the word Ask and its own button. Use pricing-tiers for subscription plans with feature lists.

Writing for it

- Set priceState to 'ask' for any package without a ruled price. The block then prints askLabel and ignores the price field, so no number is invented. - The duration (40 characters) is read after the durationLabel, so write 'Days, not months' or '2 weeks' to complete the phrase 'Takes ...'. - Use the optional keep line for a monthly offer, with a 40 character label and 200 characters of text. The label tag, such as 'Examples', says the grid is a sample.

Watch out for

A package named in 'ask' state still needs a price string in the data, but it is hidden from view and only kept for editors. The flag badge is capped at 24 characters and wraps in a narrow card, so keep it to one or two words.

Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import PricingPackages from '@/components/klarhimmel/blocks/pricing-packages';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <PricingPackages props={{
          "eyebrow": "Name the section",
          "title": "Say what the packages have in common",
          "description": "Say in a sentence or two what the packages are and how to ask for something else.",
          "label": "A short tag",
          "packages": [
            {
              "name": "Name a package",
              "summary": "Say in one line what you get from this package, and who it is for.",
              "duration": "00 days",
              "priceState": "shown",
              "pricePrefix": "from",
              "price": "00 000 kr",
              "badge": "A short flag",
              "cta": {
                "label": "Main action",
                "href": "#review"
              }
            },
            {
              "name": "Name a package",
              "summary": "Say in one line what you get from this package, and who it is for.",
              "duration": "0 weeks",
              "priceState": "ask",
              "price": "",
              "cta": {
                "label": "Main action",
                "href": "#review"
              }
            }
          ],
          "askLabel": "Ask",
          "durationLabel": "Takes",
          "keep": {
            "label": "Name the ongoing offer",
            "text": "Say in a sentence what the monthly offer covers and what it costs."
          }
        }} />
      </BlockSurface>
    </Theme>
  );
}

Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

PropTypeDefaultDescription
eyebrowstring'Name the section'Text, up to 60 characters. Optional; empty is not rendered.
titlestring'Say what the packages have in common'Text, up to 120 characters.
descriptionstring'Say in a sentence or two what the p…'Text, up to 300 characters. Optional; empty is not rendered.
labelstring'A short tag'Text, up to 24 characters. Optional; empty is not rendered.
packages{ name, summary, duration, priceState, pricePrefix, price, badge, cta }[]4 itemsList of 3 to 6. Each item: name, summary, duration, priceState ('shown' | 'ask'), pricePrefix (optional), price, badge (optional), cta.
askLabelstring'Ask'Text, up to 24 characters.
durationLabelstring'Takes'Text, up to 20 characters.
keep{ label, text }{…}Fields: label, text. Optional; empty is not rendered.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.