ComparisonTable
Marketing comparison table with check/dash boolean cells, a highlighted column and responsive overflow.
Design intent
Comparison sections are hand-built with ad-hoc check glyphs and inaccessible color-only states. ComparisonTable makes the feature/value relationship semantic and gives boolean cells screen-reader text.
npx @slipstream-ui/cli@latest add comparison-table| Feature | With an advisor | On your own |
|---|---|---|
| Accurate valuationMarket-tested range | Included | Not included |
| Buyer targeting | Curated | Limited |
| Negotiation support | Included | Not included |
| Confidentiality | Included | Not included |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| columns | ComparisonColumn[] | required | Comparison columns, excluding the feature column. Each column has a label and optional highlight. |
| rows | ComparisonRow[] | required | Feature rows with one value per column. Booleans render check/dash; strings render as text. |
| caption | string | 'Comparison' | Accessible table caption. |
| featureLabel | string | 'Feature' | Heading for the feature column. |
| valueLabels | { yes?: string; no?: string } | — | Screen-reader labels for boolean cells. |
Anti-patterns
validate_usage is the MCP tool that rejects these mistakes: the same list agents see over MCP and in the canonical markdown.
Don't use color alone
Boolean cells already include a check/dash and screen-reader text. Do not replace them with colored dots.
tsx// Avoid{ feature: 'Support', values: ['green', 'red'] }Don't use it for dense data
Use DataTable when rows are records and columns need sorting, selection or pagination.
tsx// Avoid<ComparisonTable rows={transactions} />// Prefer<DataTable columns={columns} data={transactions} rowId={rowId} />
Accessibility
- Renders a real table with caption, scope=col and scope=row.
- Boolean cells pair the visual check/dash with screen-reader Included/Not included text.
Content guidelines
Comparison rows
- One capability per row
- Parallel phrasing across columns
- Keep text cells to two or three words
Good examples
- Accurate valuation
- Negotiation support
Bad examples
- Miscellaneous benefits
Composition
Dependencies
What the registry installs alongside this component. Package imports already include these.
npm packages
- class-variance-authority
- clsx
- tailwind-merge
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+: macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA, the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.