Skip to content
Hazine

Comparison Table with Sticky Header

Native feature matrix grouped under named sections, with plan names, prices and actions pinned on top and feature names pinned at the start while it scrolls. The default full plan comparison.

How it differs. Baseline of the family: a static grouped matrix whose plan header and feature column stay pinned on both axes, with included counts per section and in total for every plan.

Install

pnpm dlx shadcn@latest add @hazine/pricing-comparison-sticky-header

Adds 2 files, 1 shadcn primitive (button), 1 Hazine item (@hazine/heading), and 1 package (lucide-react).

First time? Add the registry to components.json
{
  "registries": {
    "@hazine": "https://api.hazine.dev/r/{name}.json"
  }
}

Needed once per project. Items resolve each other through the @hazine namespace.

Props11

title
string = "Compare plans"
description
string = "Marks show what a plan includes, and limits are written out in full."
Follows the computed plan and feature count in the intro sentence.
headingLevel
HeadingLevel = 2
plans
ComparisonPlan[] = DEFAULT_PLANS
sections
ComparisonSection[] = DEFAULT_SECTIONS
priceNote
string = "Per editor, billed yearly. Readers are free on every plan."
Billing terms, set in the corner cell beside the prices.
featuredLabel
string = "Recommended"
Text of the chip on a featured plan.
currency
string = "USD"
ISO 4217 code.
locale
string = "en-US"
stickyOffset
string = "0px"
CSS length from the top of the page at which the header pins: the height of a fixed site header.
contactHref
string = "/contact"

Also accepts every prop of Omit<React.ComponentProps<"section">, "title">.

Accessibility

Pattern
Table (APG, opens in a new tab), Landmarks and headings
Keyboard
Keyboard support for Comparison Table with Sticky Header
KeyEffect
TabMoves to the table frame while it scrolls, then through each plan action in column order, then the sales link
Arrow keys, Page Up, Page Down, Home, EndScroll the focused table frame. Plan header and feature column stay pinned
Screen reader

A section labelled by its heading holds a native table with a caption, a column header per plan (plain text, because a th may not contain a heading), a rowgroup header per section and a row header per feature. Marks carry hidden Included or Not included text. The frame is a focusable named region only while it scrolls.

Reduced motion
No motion. Colour transitions only.
Checked
Not checked yet. Automated results appear here once CI has run.

Dependencies3

  • button
  • @hazine/heading
  • lucide-react

Filled chips are registry items the CLI adds for you. Outlined chips are npm packages.

Tokens shipped0

None. The item is styled by the tokens your theme already has.

More in Pricing