Skip to content
Haze UI

Comparison: two-plan matrix

A compact, responsive table comparing the features of two plans.

pnpm dlx shadcn@latest add @haze/comparison-plan-matrix
Open preview in a new tab
Liveno JavaScript

When to use

  • A buyer needs to compare two plans feature by feature
  • Plan values need clear text labels rather than icons alone

When not to use

  • You need to present plan prices and calls to action; use pricing-three-tier

Installation

Add the Haze registry to components.json once, then install Comparison: two-plan matrix with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/comparison-plan-matrix
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
idstring"comparison-plan-matrix"ID prefix for this labelled section.
eyebrowstring"Compare plans"Small label above the heading.
titlestringdemo headingSection heading and table caption.
descriptionstringdemo copyIntroduction; replace the example-plan notice with your own copy.
headingLevel1 | 2 | 32Level of the section heading.
plans[string, string]["Starter", "Team"]Names for the first and second comparison columns.
features{ name: string; first: string; second: string }[]5 demo featuresFeature names and their corresponding text values.
classstring–Additional classes on the section.

Accessibility

  • The native table identifies column and row headers and has a caption.
  • Plan availability is written in text, so it is not conveyed by color or icons alone.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI block "Comparison: two-plan matrix" with `npx shadcn@latest add @haze/comparison-plan-matrix`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ComparisonPlanMatrix from "@/components/haze/blocks/comparison-plan-matrix.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/blocks/comparison-plan-matrix.md

  • Customize with real content

    Adapt the Haze comparison-plan-matrix block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, plans, features, class. Keep the layout, the heading level rules and these accessibility details: The native table identifies column and row headers and has a caption. Plan availability is written in text, so it is not conveyed by color or icons alone. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using comparison-plan-matrix, check it fits: use it when a buyer needs to compare two plans feature by feature; plan values need clear text labels rather than icons alone. Avoid it when you need to present plan prices and calls to action; use pricing-three-tier. Alternatives: @haze/pricing-three-tier.

Dependencies

  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog