Tables

Plan Matrix

A plan comparison matrix: features are rows, plans are columns, and a yes or no is carried by both a check mark and a hidden word for screen readers.

  • table
  • pricing
  • comparison
  • accessibility

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.

put this in the header: https://vibeui.ru/c/table-011?lang=en

What the plan includes
ВозможностьСтарт0 ₽РекомендуемКоманда1 200 ₽Бизнес3 900 ₽
Проектов350без лимита
Совместная работанетестьесть
История версийнетестьесть
Свой доменнетестьесть
Единый вход SSOнетнетесть
Поддержка по телефонунетнетесть
Show the full instructions

What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.

# Install and place "table-011" (Plan Matrix) from VibeUI

## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/table-011.json

Registry item: https://vibeui.ru/r/table-011.json
Installs to: components/vibeui/table-011.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.

Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.

## 2. What it is
A plan comparison matrix: features are rows, plans are columns, and a yes or no is carried by both a check mark and a hidden word for screen readers.

A pricing matrix with check marks: every value is duplicated in words and the recommended column is highlighted. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Table011 } from "@/components/vibeui/table-011"

<Table011
  caption="What the plan includes"
  featured="Business"
/>

Read the installed file for the full prop list.

## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.

Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)

## 5. Keep exactly as installed
- the local --vibeui-table-011-* palette — do not swap it for your theme tokens
- th scope="col" on plans and th scope="row" on features: without scope a lone check mark loses its pairing
- the hidden "yes"/"no" word beside the check mark: a glyph alone is not announced
- aria-hidden on the ✓ and — glyphs: otherwise a screen reader reads them as stray text
- the role="region" wrapper with tabindex=0: without it the wide table cannot be scrolled from the keyboard
- the component's own light surface: dark text disappears on the dark catalog card

## 6. You may change
- the plans and their prices through plans
- the feature list and its values through features
- the highlighted plan through featured
- the table caption through caption

## 7. Rules
- A value may be a string — "50" or "unlimited"; then text is printed instead of a check mark.
- featured is matched against plans by string: a typo silently removes the highlight.
- More than four plans do not fit a phone — the table moves into horizontal scrolling.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.

## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.

For developers

npx shadcn@latest add https://vibeui.ru/r/table-011.json
https://vibeui.ru/r/table-011.json

Компонент самодостаточен: один файл, без зависимостей, палитра в переменных --vibeui-table-011-*. Серверный: хуков нет. Возможности — заголовки строк (th scope="row"), тарифы — заголовки колонок (th scope="col"), поэтому ячейка с галочкой озвучивается парой «возможность — тариф», а не одиноким символом. Значки ✓ и — закрыты aria-hidden, рядом лежит визуально скрытое слово «есть»/«нет»: значок и цвет не остаются единственными носителями смысла. Рекомендованная колонка помечается data-featured и подкрашивается через color-mix от акцента, отдельной палитры для неё нет. Таблица широкая, поэтому лежит в обёртке role="region" с tabindex=0 и видимым фокусом: иначе горизонтальную прокрутку не достать с клавиатуры.

Component source

The same file your agent installs. Here in case you would rather copy it by hand.

import type { ComponentPropsWithoutRef, CSSProperties } from "react"

export type Table011Plan = {
  name: string
  price: string
}

export type Table011Feature = {
  title: string
  values: (boolean | string)[]
}

export type Table011Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children"
> & {
  plans?: Table011Plan[]
  features?: Table011Feature[]
  /** Имя тарифа, чью колонку подсвечиваем как рекомендованную. */
  featured?: string
  caption?: string
  accent?: string
}

// Идея компонента: матрица тарифов, где ответ «есть/нет» несёт не только
// галочка, но и слово для скринридера. Названия возможностей — заголовки
// строк (th scope="row"), поэтому ячейка «✓» всегда читается как пара
// «возможность — тариф», а не как одинокий символ.
const STYLES = `
:where([data-vibeui-block="table-011"]){
--vibeui-table-011-bg:oklch(1 0 0);
--vibeui-table-011-fg:oklch(0.24 0.014 265);
--vibeui-table-011-muted:oklch(0.56 0.014 265);
--vibeui-table-011-border:oklch(0.92 0.006 265);
--vibeui-table-011-head:oklch(0.975 0.003 265);
--vibeui-table-011-accent:oklch(0.55 0.2 262);
--vibeui-table-011-accent-soft:oklch(0.55 0.2 262 / 8%);
--vibeui-table-011-yes:oklch(0.52 0.15 155);
--vibeui-table-011-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="table-011"]{
width:100%;box-sizing:border-box;
font-family:var(--vibeui-table-011-font);color:var(--vibeui-table-011-fg);
}
[data-vibeui-block="table-011"] [data-part="shell"]{
background:var(--vibeui-table-011-bg);
border:1px solid var(--vibeui-table-011-border);border-radius:1rem;overflow:hidden;
}
[data-vibeui-block="table-011"] [data-part="scroll"]{overflow-x:auto}
[data-vibeui-block="table-011"] [data-part="scroll"]:focus-visible{
outline:2px solid var(--vibeui-table-011-accent);outline-offset:-2px;
}
[data-vibeui-block="table-011"] table{width:100%;border-collapse:collapse;font-size:0.8125rem;min-width:26rem}
[data-vibeui-block="table-011"] caption{
padding:0.875rem 1rem 0.5rem;text-align:left;
font-size:0.9375rem;font-weight:650;
}
[data-vibeui-block="table-011"] th,
[data-vibeui-block="table-011"] td{
padding:0.625rem 0.875rem;text-align:center;vertical-align:middle;
border-top:1px solid var(--vibeui-table-011-border);
}
[data-vibeui-block="table-011"] thead th{
background:var(--vibeui-table-011-head);vertical-align:bottom;
}
[data-vibeui-block="table-011"] tbody th{
text-align:left;font-weight:500;
}
[data-vibeui-block="table-011"] [data-part="plan"]{
display:flex;flex-direction:column;align-items:center;gap:0.125rem;
}
[data-vibeui-block="table-011"] [data-part="name"]{font-size:0.8125rem;font-weight:650}
[data-vibeui-block="table-011"] [data-part="price"]{
font-size:0.75rem;font-weight:400;color:var(--vibeui-table-011-muted);
font-variant-numeric:tabular-nums;
}
[data-vibeui-block="table-011"] [data-part="badge"]{
margin-bottom:0.25rem;padding:0.0625rem 0.375rem;border-radius:9999px;
background:var(--vibeui-table-011-accent);color:oklch(1 0 0);
font-size:0.625rem;font-weight:650;letter-spacing:0.02em;text-transform:uppercase;
}
[data-vibeui-block="table-011"] [data-featured="true"]{background:var(--vibeui-table-011-accent-soft)}
[data-vibeui-block="table-011"] thead [data-featured="true"]{
background:color-mix(in oklab,var(--vibeui-table-011-accent) 14%,var(--vibeui-table-011-head));
}
[data-vibeui-block="table-011"] [data-mark]{font-size:1rem;line-height:1}
[data-vibeui-block="table-011"] [data-mark="yes"]{color:var(--vibeui-table-011-yes)}
[data-vibeui-block="table-011"] [data-mark="no"]{color:var(--vibeui-table-011-muted)}
[data-vibeui-block="table-011"] [data-part="text"]{font-variant-numeric:tabular-nums}
[data-vibeui-block="table-011"] [data-part="sr"]{
position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="table-011"] *{animation:none!important;transition:none!important}}
`

const DEFAULT_PLANS: Table011Plan[] = [
  { name: "Старт", price: "0 ₽" },
  { name: "Команда", price: "1 200 ₽" },
  { name: "Бизнес", price: "3 900 ₽" },
]

const DEFAULT_FEATURES: Table011Feature[] = [
  { title: "Проектов", values: ["3", "50", "без лимита"] },
  { title: "Совместная работа", values: [false, true, true] },
  { title: "История версий", values: [false, true, true] },
  { title: "Свой домен", values: [false, true, true] },
  { title: "Единый вход SSO", values: [false, false, true] },
  { title: "Поддержка по телефону", values: [false, false, true] },
]

/**
 * Матрица сравнения тарифов: галочки продублированы словом для скринридера.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Table011({
  plans = DEFAULT_PLANS,
  features = DEFAULT_FEATURES,
  featured = "Команда",
  caption = "Что входит в тариф",
  accent,
  className,
  style,
  ...props
}: Table011Props) {
  const palette = {
    ...(accent ? { "--vibeui-table-011-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-table-011" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="table-011"
        className={className}
        style={palette}
      >
        <div data-part="shell">
          <div
            data-part="scroll"
            role="region"
            aria-label={caption}
            tabIndex={0}
          >
            <table>
              <caption>{caption}</caption>
              <thead>
                <tr>
                  <th scope="col">Возможность</th>
                  {plans.map((plan) => (
                    <th
                      key={plan.name}
                      scope="col"
                      data-featured={
                        plan.name === featured ? "true" : undefined
                      }
                    >
                      <span data-part="plan">
                        {plan.name === featured ? (
                          <span data-part="badge">Рекомендуем</span>
                        ) : null}
                        <span data-part="name">{plan.name}</span>
                        <span data-part="price">{plan.price}</span>
                      </span>
                    </th>
                  ))}
                </tr>
              </thead>
              <tbody>
                {features.map((feature) => (
                  <tr key={feature.title}>
                    <th scope="row">{feature.title}</th>
                    {plans.map((plan, index) => {
                      const value = feature.values[index]

                      return (
                        <td
                          key={plan.name}
                          data-featured={
                            plan.name === featured ? "true" : undefined
                          }
                        >
                          {typeof value === "string" ? (
                            <span data-part="text">{value}</span>
                          ) : (
                            <>
                              <span
                                data-mark={value ? "yes" : "no"}
                                aria-hidden="true"
                              >
                                {value ? "✓" : "—"}
                              </span>
                              <span data-part="sr">
                                {value ? "есть" : "нет"}
                              </span>
                            </>
                          )}
                        </td>
                      )
                    })}
                  </tr>
                ))}
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </>
  )
}